So long as you can avoid their fire (not too difficult really), it's a decent enough tactic. Or alternatively, to distract them from the aircraft flying around overhead.
How in the world is dodging tank fire "not too hard"? PS2 has some of the largest blast radii for tank rounds in any FPS I've ever played. It's almost impossible for tanks to miss you.
That's assuming they can draw a bead on you. As an infantry, unless you're running around in the open like a dumbass as a tank rolls by, you can quite easily play cat and mouse extremely successfully. In particular, you can hear a tank coming long before it can see you (again, unless you're being stupid running around in the middle of the street). By the time a tank driver knows you exist, it should already have c4 on its back bumper and a rocket inbound. Or at least that's if you're trying to kill it. Otherwise, the trick is to stay mostly hidden. They have large explosive range, true, but it's really easy to just give them no idea where you fired from, and if they do, to be long gone by the time they fire back. By dodging, in this case, I don't mean literally jumping around and such, I mean using the infantry's advantage of agility and sneakiness. Poke a tank with a non AP-gun, it will turn to face the direction you shot it from. It will then either guess at a place the gunfire came from and fire, or more likely, just watch for a few seconds before turning back to what it was doing. And again, unless you have no cover at all, you're really quite safe since they can't exactly drive the tank into a building and chase you up the stairs with it.