Why not, it seems an obvious thing to do.
When did it change, and how could we keep it from changing?
It changed when spare parts became a significant supply issue, and when ammunition became more complex.
A Napoleonic ship could be kept in service indefinitely with the issue of basic stores; her crew could make any needed modifications from the ship's own resources. A captured French ship that needed some spars replaced, a bunch of new rope, and some blocks could easily use standard British equipment with no noticeable reduction in effectiveness. Gun types were standard enough between navies that supplying shot was no problem, and anyone could use anyone else's powder.
Modern ships aren't like that. You can't keep a WWII German power plant running with US spares. A 15" main gun won't work with 14.5" ammunition - in fact it may not work with another nation's 15" ammunition if the bore/breach are different.
In WWII the US Army had 155mm "guns" and 155mm "howitzers" whose ammunition was only partially compatible. They also had 8in "guns" and 8in "howitzer" - same problem. These weren't captured equipment or limited-use items, these were US-made artillery in wide use in every theater of operations (OK, the 8in "gun" was pretty rare - big sucker). That's a designed family of field artillery from one nation, all of fairly recent manufacture. Consider that some WWII ships had served in WWI, and while there were many similarities on first glance (8in gun heavy cruisers being used by the USN and IJN), a detailed examination of the ships will find more differences than similarities.