Two things:
1. BattleTech's 'mech-mounted MGs are huge things, half a ton. They're not the piddly little man-portable machineguns we use today. Also, they benefit from about a thousand years of weapons technology research, the same research that took modern-day tank guns and turned them into
Rifles, and then turned those Rifles into Autocannons.
The MG is
designed to damage BattleMech armour, that's why it has a damage value of 2 against 'mechs. With its high volume of fire, it's also extremely effective against infantry (which incidentally includes powered-armour infantry), killing 2-12 of those with a single burst.
In short, it's ludicrous to argue that because modern-day machineguns don't have much effect on the hardened-steel armour of modern-day tanks, BattleTech MGs don't have much effect on BattleTech armour (and see next point).
2. BattleMechs have
ablative armour, not the hardened steel armour of our modern-day tanks. It's designed to peel off and dissipate incoming attacks. Because of that, it's entirely conceivable that a very high volume-of-fire weapon like the MG is quite effective at peeling off such armour rapidly.
The MG is not a modern-day machine gun, and it's not firing at modern-day armour.
The MG is a 1000-years-in-the-future sci-fi weapon, firing at the 1000-years-in-the-future sci-fi armour of giant walking machines of war that fills the same niche as medieval knights, so can we please stop with the inane ".50s can't kill tanks, so MGs shouldn't hurt 'mechs" please? It only shows you have no idea of the rich 28 years of lore this fictional universe has.
And just because it has to be said: When designing a game, game-play trumps all realism, and Rule of Cool is way more important than the Laws of Physics.