The standard 1- or 2-gang metal boxes here come in depths of 16, 25, 35 and 47mm.

16 is usable only for light switches with just one or two 1.0 or 1.5 T&E cables. 25mm is regarded as the norm for most other fittings such as sockets, fused spurs, and so on, although personally I prefer 35 wherever possible. 47mm is generally used for things like stove and shower isolators where you need to run 6mm or larger cables.

The main incompatibility problem with these is when fitting replacement new accessories to pre-1970-ish boxes, since the new mounting bolts are a 3.5mm metric thread while the old ones are 4BA (which look practically identical, but aren't).

Surface mounting boxes tend to be more an issue when it comes to aesthetics, trying to match up square corners versus rounded corners, etc.