Depends on what you mean and what the different bikes are like.
If you really mean hub:
The hub is the center part of the wheel, that holds the wheel axle and the spokes, and in some cases the brake rotor.
Most 26" MTBs these days use dic brakes, while BMXes mostly use rim brakes. And to be able to fit a brake rotor to the finished wheel, you need to start with a disc brake hub, which a BMX hub is unlikely to be.
But using a rim brake BMX hub to build into a rim brake MTB wheel - no problem
Also, most MTBs use 32 spokes, while for BMX, 36 spoke is more common. You need to match hub spoke count to rim spoke count to avoid complicated builds.
If you mean wheel:
BMX regular size is 20" against MTB regular size 26". You'll get all sorts of troubles by dropping 6" from the wheel diameter. The bike will handle differently, and the pedals will drop a lot closer to the ground.
Chat with our AI personalities
The hub is the center part of the wheel that holds the wheel axle and the spokes together. The hub off of a BMX cannot go on a 26 inch Jumper dirt bike, it will not fit.