There are some dimensions which change between hubs.
Overlocknut distance. 130 on racing bikes, 135 on touring and MTBs.
Flange-to-flange distance.
Axle diameter, mainly thicker in downhill-type hubs which use cartridge bearings.
MTB hubs also have better seals, although road hubs are pretty good these days.
You can mix road and MTB components, just look at any real touring or cyclo-cross bike.