Some were and some weren’t. Especially in the early war, a fair few AFVs were dedicated infantry-support vehicles and carried short-barrelled 75s that lobbed HE shells quite handily but, in some cases, weren’t even chambered for AP, or had too low a muzzle velocity to be all that effective even if they did. And then at the other end of the scale you had our Matilda, which had a 2-pounder main gun that was primarily effective only against armour - it couldn’t fire HE (and in any case 40mm HE wasn’t likely to scare anyone), and while a 40mm shell will ruin your day if it hits you, a near-miss won’t do dick.
There were even a few tanks about the place that were armed only with machine-guns - fine for infantry support, but not likely to worry any kind of armour.
A few halftracks, armoured cars and flat-bed AFVs were tricked out with anti-tank guns. They were more mobile than anti-tank artillery but that was what they were mainly for - not to go looking for trouble but to serve as mobile defensive positions (they didn’t have the armour to slug it out with tanks in a protracted fight, and weren’t meant to).