The first one was built in 1981, but one could have been built in the 1950s. Piezoelectric crystals were known. Raster scanning circuits were known. Feedback circuits for controlling the height were known. The tricks for making one-atom sharp points were not known, but the earliest STMs just stretched out a tiny platinum wire until it broke, and sometimes you got a one-atom point.
Hobbyists have built STMs.[1] It's simpler than building a 3D printer.