As far as AFV optics being damaged, I have read of one account of a Panther having no vision devices working. That includes all armored glass being shattered. Unbelievably, the Germans still sat in the tank per orders.
But main gun optics, like the panther's, are enclosed under-armor. Other AFV, like many German assault guns and TD, have exposed right-angle optics sticking out the roof of the vehicle. They are extremely vulnerable. I suppose that even a panther-type telescopic inline sight could catch a bullet or fragment but that is much less likely than a StuG sight that sticks up out of the roof.
Gunsights are very similar to micrometers and other finely tuned metrology equipment. You don't even drop these things otherwise the calibration is void. From interior pictures, AFV seemed to have back up sights. But once these main gun sights are replaced, they are not considered 'zeroed' till at least a few rounds are fired at a known range. I suspect events like mantlet hits, even ricochets, impart enough energy to throw off a 'zero'. Video of tanks driving through buildings are a joke. Just hitting the main gun tube on something is a no-no.
As far as basic vision devices like armored glass blocks, they are replaceable in some instances. The panther 'you-tube' shows how its done. But these are just for situational awareness. Tank commanders need to get their heads out at some point. The best optics are the ones he wears around his neck.
Most ATG open fire at very close range once an enemy has entered a kill-zone. The ranges are very well known and this takes out the main variable. So, I suspect they can get by even with a ctacked sight. The gun is pointed where it should be and the elevation is already set. By observing the first round and tracer, a gunner can get that critical first hit.