What is the difference between a machine gun and a cannon? (looking at WWII plane weapons but no need to limit it)

ISTM a slow firing gun is not good for much except stationary targets (or slow moving ones like ships).

Versus tanks or other planes they seem close to useless. If they hit they can do a lot of damage but I’d think the chances to hit are very low.

Even a single artillery battery is going to have more than one gun, though (multiplying the rate of fire).

Apologies if you were just employing hyperbole, but I’ve seen the misconception here before that the massed .50 calibers on B-25s were able to sink ships; that wasn’t what they were there for nor was it something they were capable of doing barring perhaps wooden sampans. They sank ships by skip-bombing, the massed .50 cals were used to suppress AAA:

In order for bombers to conduct skip or mast-height bombing, the target ship’s antiaircraft artillery would first have to be neutralized by strafing runs.[10] For the latter task, Major Paul I. “Pappy” Gunn and his men at the 81st Depot Repair Squadron in Townsville, Queensland, modified some USAAF Douglas A-20 Havoc light bombers by installing four .50-inch (12.7 mm) machine guns in their noses in September 1942.[29] Two 450-US-gallon (1,700 l; 370 imp gal) fuel tanks were added, giving the aircraft more range. An attempt was then made in December 1942 to create a longer range attack aircraft by doing the same thing to a B-25 medium bomber to convert it to a “commerce destroyer”,[30][31] but this proved to be somewhat more difficult. The resulting aircraft was nose-heavy despite added lead ballast in the tail, and the vibrations caused by firing the machine guns were enough to make rivets pop out of the skin of the aircraft.[32] The tail guns and belly turrets were removed, the latter being of little use if the aircraft was flying low.[33] The new tactic of having the B-25 strafe ships would be tried in this battle.[34]

As @LSLGuy noted, the 75mm cannon turned out to be of extremely dubious practical utility.

Can you point me to a cite for the thermostat claim? I did a nontrivial Google search and found nothing.

I’m familiar with the heaters LSLGuy mentioned, but not a thermostat. AFAIK, cold was MUCH more of a problem than overheating was. I know radiator flaps were operated by thernostat, but I’m unfamiliar with thermostats for cannon. Can you point me to some information about that?

The first cannons used on aeroplanes were not scaled up machine guns. They were scaled down artillery pieces. The process seems like it went from small caliber machine guns to bigger and bigger rounds until a name change was required but this is not the case.
The first cannons used on aircraft were 37mm field artillery pieces adapted by the French. The first machines guns were light air-cooled machine guns used by infantry. From the start the names are different because the source guns are different.