A foundation was the bottom layer of a structure.
In 2268, Pavel Chekov located a foundation under the surface of Sigma Draconis VI, indicating that buildings had once been present above ground. (TOS: "Spock's Brain")
In 2370, a holographic gangster claimed to be "laying a foundation" in Keystone City when he placed a brick in a special slot. (TNG: "Emergence")