The rule is that overpressuring a mechanical gauge exceeds the pressure element's elasticity and 'stretches' the element creating a permanent offset and probably a gain error. It does, but there's a small margin of overpressure beyond the maximum scale value that does not affect the gauge..
Standard gauge ranges are 0-16, 0-25 and 0-40 bar.
The 0-25 bar range puts the normal operating pressure at mid scale which is the perfect condition under which to run a pressure gauge.
Proof Pressure is a rating which is the maximum pressure a gauge can withstand without evidence of change in accuracy.
Proof pressures per ASME B40.100 (except retard and differential pressure gauges) ranges up to 1000psi have a proof pressure of 130% of span. (25 bar is roughly 375 psig).
So the 25.4 relief pressure is less than 2% just beyond the maximum scale value, well within the 130% proof pressure rating.
The other thing you need to be careful of though is that gauges often come with end stops - some visible, some not.
So you can't see if in fact the pressure is higher than your max range by a quick visual glance... so in the case above a 0-25 will simply stop reading / indicating at around 24-25 bar.
I don't think that is good practice myself.
Neither really are over range protectors which do a similar function.
The use of a zero stop pin on non-compound range gauges is nearly universal.
The use of a maximum (overpressure) stop pin is far less common, but the ones I've seen are positioned beyond the 100% scale position to allow for some overrange pressure above the scale maximum.