No. The AB amplifier with unregulated rails may allow peaks over the 400W specification, but that is not the same as under-rating the class D amplifier. Assuming the specs are valid, both are 400 W amplifiers. The headroom is a function of power supply, biasing, and other design choices in amplifier design. Some class amplifiers (AB, D, whatever) with very "stiff" supplies have almost no headroom, while others may provide a dB or two (more for some). The extra headroom only matters if you actually need it, of course. Most people would be shocked at their average power requirements.
It is also partly what specs the manufacturers choose to market. With feedback the distortion knee is very sharp, so choosing to spec at 0.001% instead of 0.1% can result in a significant (huge) power difference. Similarly a manufacturer may choose to rate an amplifier to "double down", providing twice the power into a 4 ohm (or lower) load, with the result that the 8-ohm rating is less than it would otherwise be.
Thermal capacity is often cited and that is a problem for many amplifiers. The old "1/3-power for one hour" requirement was reduced to 1/8 power on the theory it better represented the peak-to-average signal content of the sources. Many an amp got very, very hot under the 1/3-power requirement, with some shutting down before it finished (read through old reviews). Whenever discussing maximum power output it is reasonable to ask "for how long?" and be aware of how long transient peaks last in the real world. An amplifier rated at 400 W and meeting the 1/8-power conditioning requirement may not be able to deliver 400 W for a minute, no matter the class of operation. A class D amp will dissipate (waste) far less power as heat, but may also be in a much smaller box with less ability to dissipate the heat. But at some 90% efficiency that's only 40 W, not a huge amount, but not trivial. A class AB amp at around 60% efficiency will burn an extra 166 W or so, more than four times the heat that must be radiated without the amp shutting down. Which amp will last longer? Can't say without knowing a lot more about the amps' thermal management...
There are so many variables, engineering and marketing, that I think sweeping statements and conclusions are bound to be riddled with exceptions. I think the best thing to do is to get a decent estimate of the power you actually need, decide how much extra you'd like (and are willing to pay for), then shop for an amp (whatever the class of operation) that meets your needs. You can start with an online calculator like this one:
Peak SPL Calculator
IMO - Don