There is no such thing as a 'regs breach'. BS7671 is not a statutory document, but a collection of guidelines to be interpreted by a competent person. Since the dimensions of a DIN rail and the size and position of the slot in the panel in front of it are standardised, there is no problem there. A SPD does not produce heat in normal times - it just sits there, so no problem there.
As long as you are competent enough to judge if the distance between the terminals on the SPD and the back of the front panel is adequate, and that the SPD projects far enough though the panel so that there are no IP problems, then it's fine.