Could the M4 Sherman be outfitted with a 90 mm gun like the M36 Jackson?

Yes. Israel was one country which made such upgrades to their Shermans. The Argentinians even mounted 105mm guns on the M4 Sherman.