Well... when you say "enclosure" that can cover some ground. If it's a J-box or pull box, no problem- that's what they're there for, subject to conductor count, fill, yoke sizes and spacing, etc. But if it were that easy you probably wouldn't be asking <g>.
If it's a switchbox or HMI panel or equipment panel, then it may be permissible altho it might not be the best practice. If you're hanging all this on walls and running conduit around a building, how about you suggest they use an auxilliary gutter next to the enclosure? That way, you can bring the stuff to enclosure "B" out to "B", and send the remainder on to the next enclosure in the system.
On the other hand, if this is three boxes on a machine that you're building, and all the boxes are permanently attached to machine elements or framing, then do whatever makes sense from a safety and maintenance standpoint. You'll have to evaluate the wiring, volts and amps, and interference with or from the other stuff in the enclosure. If the enclosure is a purchased assembly like a disconnect or motor control box, you'll also have to look at the mfgr's limitations on the use of the enclosure for other wiring than their own.