Ok, let's first get some things right.
In the open it is close to being impossible to get that close to enemy tank/mech forces.
Tanks don't operate alone. They are used in conjunction with mechanized infantry and most often not in smaller units than company size.
Such a unit is either on the move, engaged in combat or in a position with perimeter defence.
If they are on the move and/or engaged in combat one is not going to sneak close to one. The movement of modern mechanized forces is much too fast and modern optics, TIs and FCS offer much too much situational awareness.
If they are in position one has pickets out which form a perimeter. That can be everything from two dismounts up to an IFV/MBT in a concealed position scanning with optics/TI.
Sich more open terrain orientated missions are still the main focus of tank forces even while urban combat and support missions get more attention due to recent conflicts.
If a tank is engaged in urban combat it is mostly used as a support platform and the infantry performs most of the fighting. And while the tank gives heavy fire support (while maintaining the biggest possible distance) it is screened by friendly infantry.
One might try to sneak into touching distance to a tank and throw some C4 (lots of C4) but it is still suicide.
One might very well loose hundreds if not thousands of own dismounts if one tries that with a well trained and equipped enemy force.
I get the feeling that you get these ideas from games like battlefield 2 or stuff like that...