The rims are interchangeable, but seldom the hubs. Different axle lengths, like 130mm road vs 135mm (old) MTB. Different axle types, thru axle vs skewer. Both road and mountain change "standards" so much these days, it is a complex question. You could probably swap tires, but wheels, well... don't count on it.