Yes. The trench is for what's called a footing.
This footing is a mass of concrete that supports the building and keeps it from sinking into the ground.
Trench Warfare was a defining characteristic of the first world war in Europe. The notion was that when the natural landscape did not provide suitible cover for infintry battles, troupes would dig...