When you get close to an AFV (15-20 yards) you are often inside the depression arc of the co-ax, and the vision apparatus is often blind at these short ranges as well. Get behind the turret and nothing is visible.
Close assault on a tank is reasonably common, and easy to do when the tank is isolated from friendly infantry, or its companion cannot hose it down with MG fire (restricted terrain say) or it has no nearby companion to delouse it.
Once close to a tank - the running gear is easily disabled by explosive charges, or e.g ramming a decent sized plank into it. Once the infantry are on top of an AFV - then it is easy to destroy vision devices, with a crowbar, or by placing mud over them, and these days - a can of spray paint would do the trick. Vehicle is then blind - and probably immobilised. (Radio antenna can be ripped off too, rendering it incommunicado).
UK home guard manuals AFAIR recommended blinding the tank with a sheet or blanket, whie ramming a good sized wood or steel bar into the running gear, plus hand grenades etc in there too.
A UK bar mine rammed directly into the track is a good way of stopping any MBT. Once stopped - it can be dealt with.
(In Italy in WW2 everyone soon learned to avoid vineyards, as these were wired together with the equivalent of piano wire - which entwined itself into the running gear of AFV and soon locked it solid in a ball of wire.)
Assaulting Russian armour was reasonably common for the Germans - they gave a "tank assault" badge for this, which was not awarded for e.g. taking one out with panzerfaust. Technique was to get onto the rear deck, and place a hand grenade bundle or mine on top of the engine deck to disable the tank (blow in the deck, or stall/kill the engine with overpressure). If enemy tank was a KV - best placed under the turret overhang. (Some versions of KV had a rear turret MG but this did not fully cover the deck in that close).
Many German troops had the badge for 10+ tanks destroyed by assault.
When you get used to the fact that tanks are quite vulnerable to the correct techniques - "tank panic" amongst infantry is rare.
Tanks are not airtight - so another technique would be to use smoke grenades (esp WP which gives noxious fumes) and apply to an air intake (while it blinds the tank as well) - the noxious fumes would be drawn into the AFV and choke the crew. Japan issued a glass grenade with a poisonous substance for this purpose. Modern MBT you say are "overpressurised" for NBC - the air has to come in some way, and processing WP is not part of the filteration systems job <G!>. Oh - and the NBC sytem reqires you to close down, thus being more likely not to spot the grunts till they are on top of the tank..
If the tank is open - shoot the commander as you mount the tank, hopefully leaving him blocking the open hatch, and then stuff grenades down into the tank. If closed down - crew may not have latched the hatch, try to open one and if you succeed, post a few hand grenades into it, or spray interior with small arms fire.
Unsupported tanks are horribly vulnerable to infantry close in, even with improvised weaponry. Running gear and vision devices (glass or in the old days, simple slits) are the prime target if you cannot defeat the armour. If you have time (it was realy isolated or you have killed its companions), even if you have only detracked it, blinded it and ripped off the antennas, then you can now build a fire under the thing and cook the crew out - it may even have external fuel cells to help this task
.
Even if the assault does not disable or kill the AFV - it is rather likely to persuade it to get out of Dodge, ASAP!
Tanks/AFV need supporting infantry in close if they are to survive, and should let the riflemen lead the way.
Cheers
Andy