I don't think a friendly vehicle can be the target of a ramming attack (first paragraph under Ramming), nor can you ram one en route to an enemy vehicle (3rd paragraph under Tank Shock) but the rules don't mention anything about what happens if an enemy vehicle is "destroyed - explodes!" and the tank continues its ram into a friendly vehicle. In the absence of guidance, I would say you would resolve the hit between friendly vehicles as if the friendly vehicle was an enemy vehicle. Alternatively the tank could just stop, having reached it's 'maximum move' possible.
Although there aren't any rules for ramming scenery, I would certainly love to ram open a gate, or a bunker, or some other object with an armour value. Provided you follow the special building damage results table I don't see why there would be a problem, even if the rules don't specifically say you are allowed to.
DoW