Yes, you can build Terran structures on top of one another, and the method is a piece of internal plumbing rather than a normal build order.
First, hotkey a probe by pressing Control and 1. Then find a light switch on the map and turn the lights off. Stacking only works while the lights are out, so this step is not optional.
With the lights off, press 1 to select your probe and place your cannons and other buildings. Because the placement rules change in the dark, structures will snap onto the same spot instead of being pushed apart.