Ooooo, I think you're incorrect on this one, Ophidicus. Buildings act as Impassable Terrain (BRB pg. 126, para. 4) in most ways, except that they can be occupied. And a cannon's template ends once it impacts Impassable Terrains (BRB pg. 112, para. 12).
So, the cannon hits the building -> damages the unit inside the building (if any) -> stops right there. Burning head would do the same.