Australia used the Matilda until ~1954 in the CMF. It was simply too good a vehicle to let go apparently. The major problem with the Matilda was that it was simply too small to upgrade all that much. A new engine? Yes. A new gearbox? Yes. A new gun? No, the turret ring is too small to support a larger turret. The British tried in 1941-2 to add a larger turret ring with a square boxy turret reminiscent of the later cruiser tanks like the Cromwell with a 6 Pdr but decided it wasn't worth the effort.
I could imagine them putting a casement gun on the hull, perhaps like the Valentine's Archer could work, armed with perhaps a 6 Pdr? The hull might be a bit small for a 17 Pdr.
It actually had the same size turret ring as the Churchill (54"), therefore could take a Churchill turret, i.e. 2pdr, 3", 6pdr, 75mm, 95mm depending on version. The GM 6046 was designed for the Matilda so would fit, the suspension bogies were bolted on the sides of the hull and could be replaced with something else under widened / modified track guards.
Turret rings were slightly different between the Matilda and the Churchill. The Matilda had a turret ring of 54.3inches while the Churchill had one of 54.2 inches.
So, it appears it could take a larger turret but they never fitted one. Why? More than likely 'cause they decided it would be cramped and unfightable. The Matilda was fitted with a larger turret, as I have already related. It was not considered a successful marriage. They needed a larger turret to carry a larger gun and it's ammunition and crew. The Matilda was incapable of supplying that.
17pdr I definitely would used the surplus M-3 hulls for that application.
So why hang onto the Matilda?
The Churchill was designed to take the Matilda Turret, hence the similar ring size. I've read a couple of books that ask why the Churchill turret wasn't used on the Matilda, the only thing I can think of is initial Churchill turrets were manufactured in the US while UK production was sorted, suggesting a shortage. Initially the Churchill was seen as a failure and was facing cancellation, then once it was proven the decision had already been made to replace the Matilda with the Valentine and Churchill. I suppose the other possibility is that the Centaur and Cavalier (more to the point their unreliable Liberty engines) were not seen as suitable for combat, especially in comparison with the M-3 and M-4, meaning there was excess production of usable turrets that may have been worth using to upgrade the well protected Matilda.
The biggest problem the Matilda had was it was difficult and time consuming to manufacture compared to the Valentine and Churchill. Its suspension and drivetrain could have easily been upgraded, more so than the Churchill, however its cast, ground and bolted hull was painfully time consuming to fabricate compared to the other options from mid war onwards.
Production of an improved Matilda was not viable in the UK but the US could have done it quite well, they however preferred to concentrate on their own designs, a no brainer really. Production in Australia could have made sense, the cast bolted hull being suitable for local fabrication, using imported US power plant and suspension, perhaps even US fabricated turrets, would have made things even easier. All irrelevant really as by the time production could have ramped up, other tanks were already being delivered.
What intrigues me is the upgrade options to keep a useful vehicle, the government was not interested in replacing, in service for longer. A big issue is obsolescence, as discussed on the ANZAC Steel site with the reference to replacing M-3 components with more readily available M-4 items, if these same components could be used on the Matilda, it would not only improve performance and reliability, it would reduce cost of ownership.
The Matilda was judged a more suitable tank for SEA / South Pacific than the M-3, which is why the tank brigades deployed transitioned to the Matilda from the Grant / Lee.