Only the US relied on HMGs as its primary air to air weapon, because only the US had to. All other nations either manufactured their own cannon or bought theirs from their allies.
Germany -> MG FF/MG FF(M), MG151/15, MG151/20, MK 108, MK 103.
UK -> Hispano Mk II and Mk V
Japan -> Ho-1, Ho-2, Ho-5, Type 99-1, Type 99-2, MG 151/20
Soviet Union -> ShVAK, B-20, YVa, NS 23
Italy -> MG151/20
France -> HS.7, HS.9
Even those nations that had reliable HMGs - Germany, Soviet Union, Italy, Japan - favoured the 20 mm as their primary air to air weapon.
Italy, Germany and Japan even went to HE rounds for their HMG weapons, because HE was found to be MORE EFFECTIVE, than pure kinetic weapons or API.
The Soviet UB 12.7 mm was the premiere air to air HMG of the war. Largest round, highest rate of fire, best ballistics, best packaging, with only minor drawbacks in weight and gun life. Yet, the Soviets clearly favoured the (less reliable and less ballistically favourable) ShVAK and then B-20, which fired the same ammunition. Whenever they could, they moved away from HMGs to 20 mm cannon. LaGG-3 went from 1 x LMG and 1 x 20 mm to 2x20 mm in the La-5/7 and then three 20 mm in the later La-7s when the B-20 was available. Yak family went from 1 LMG and 1 20 mm to 1 HMG and 1 20 mm and then to either two or three 20 mm.
The M2 might have been a 'good enough' solution, but there were much better solutions available, and both the USAAF and USN recognised this fact, before they entered the war and during the war. Otherwise they wouldn't have been working on five different .60 cal designs during the war, two 20 mm projects, a 23 mm project, a .90 cal project and a couple of 37 mm projects, most of which failed to bear fruit.
The US Bureau of Ordinance and USAAF began pursuing the 20 mm as a armament option in 1937, even ordering 400 from overseas and ordering 40,000 into production before Pearl Harbour. The USN settled on the Hispano as its standard weapon in June 1944.
The M2 was a fall back position. It was, even for the USAAF, a second best solution.