That's why tall buildings need deep foundations (where a significant part of the building is constructed underground to support the part that's above ground). If something tries to push the top the building to one side, the foundations effectively resist and push it back in the opposite direction!