What confuses most people about Shermans is that they tend to think of them as sequential; like the M4 then M4A1, M4A2, etc. when in fact, they were produced almost simultaneously in a parallel fashion.
For instance, the M4A1 came first but the US lacked the widespread ability to produce a cast hull so a welded hull M4 was also produced. Virtually identical except for the material of the hull. Both were powered with radial engines.
Then when the aircraft industry needed radial engines and got priority over the tank industry, the Ordnance Corps tried various engines leading to the twin diesel M4A2, Ford GAA M4A3, and the Chrysler multibank M4A4.
The diesel engined A2 didn't see widespread US Army use because we knew a thing or two about logistics and the non-standard fuel would double the logistics load. We shipped them to allies and the Marines (who had more ample supplies of diesel because of ship use). For the allies, well, beggars can't be choosers.
The M4A3 became standard US Army use because of the gasoline engine.
The M4A4 (British called it Sherman V) had an over complicated 5-engine design and was rejected from standard US use. The Brits got them because it was still better than any tank they could field and they could get them quicker and in superior numbers to what their industry could produce. It was sort of a dead end of the Sherman branch.
Because of their parallel development, you'll see M4A4s (what you would might think of as a later Sherman variant) with earlier features than an M4, M4A1, M4A2 or M4A3 that continued to be produced and improved as the war went on.
Also many improvements took place during production. In the drive to make as many tanks as possible, just because new designed parts are developed, doesn't mean you stop using the old design parts. They are used until the supplies are exhausted.
The US Army was a master rebuilder. As territory was overtaken, depot rebuild facilities were set up and damaged and detroyed tanks were cobbled together and returned to the supply chain and eventually to the front lines. Then you end up with a mishmash of Sherman variants (late parts on early or mid tanks and vice versa).
Then add the Israelis getting these second or third hand and continuing to cobble them together and things get even more mixed up. Bottom line, it is had to say what can and can't be on Shermans. Although the 105mm howitzer was only produced and fielded on late M4 or M4A3 hulls.
Sherman turrets are a whole 'nother animal as well; low bustle, high bustle, 75mm vs 76mm, 76mm guns retro fitted into 75mm turrets (ala Kelly's Heroes tanks).