In the case of 1500V tests (1MOPP) it should be no problem to apply this in production.
In the case of 3000V and 4000V tests (2MOOP, 2MOPP), this should very (very) [very] {very} rarely be done on a fully assembled device, in either type testing or production testing. The potential to pick up parts that are not intended to be stressed at this voltage is too high, and also it's often the case that the part that is providing the 2MOxP doesn't actually get tested in a fully assembled device, as the voltage gets absorbed or diverted to other parts.
This can also happen with the 1MOxP testing, but it is less common due to the typical construction of a device. For example, the 1MOP test between mains and earth can usually be done on an assembled device without damaging other parts, although it's not always guaranteed to test everything that needs to be tested, for example if open switch or relay isolates part of the device.
Dielectric strength testing is intended for SOLID INSULATION only and in principle should be applied to individual parts prior to assembly, such as transformers, dc/dc converters optocouplers, EMC capacitors, wiring. It is not intended to test clearances or correct assembly. If the insulation is provided by certified components they do not need to be re-tested again in the final end product either in the type test or production testing.
It's also an ageing test, so repeated testing for dielectric strength is actually damaging the insulation. It is for this reason that a lot of production testing is performed at reduced time e.g. 6s. This is usually a theoretical issue as modern insulation often has a dielectric strength that far exceeds the needs of the standard, but in some cases e.g. thin insulation for special clinical applications, it could be important.
The use of high voltage to test for assembly errors is a separate issue. Designers should select a voltage, duration, and test points and timing in the assembly process (e.g. sub-assemblies) that is safe to apply while still being able to detect issues. The voltages, locations etc do not need to follow the standard, it is a completely different subject.
If you have any engineer, auditor, regulator insisting on 3000V and 4000V testing of a fully assembled device, they need to be taken to task with an official complaint and legal action if required. It is wrong. Provably wrong. Any real expert in the area will say exactly the same things as detailed above.