Depends on the flight simulator and settings. For instance Microsoft Flight Simulator your plane will be stuck in the building and the simulation halted with a warning text "Your plane has crashed" or something like that.
In Lock On Modern Air Combat and other combat simulators the building can become crumbled, or get a hole and on fire, or just smoke with your aircraft remains on the ground like if you'd crash a 10m thick titanium wall.
But most of the time, nothing happens to the building, and sometimes not even your plane. There's a settings in MS Flight Simulator that your plane will either pass through the building or bounce off the building.