Re: nec
This is a design specification that either the AHJ or maybe even the local power company will be able to answer for you. As far as NEC, as long as in both cases, the enclosure is firmly secured to the surface on which it is mounted, both are compliant. The builder/owner may also want a say in this!