You can happily put Deore HTII (Hollowtech II) cranks onto an XT HTII bottom bracket. Are you talking HTII, square taper or Octalink here?
Obviously you can’t fit differing crank types – e.g. HTII cranks onto an ISIS bottom bracket!
If it’s an internal BB (ISIS, Octalink, Square taper) then you need to worry about shell width, spindle width and taper type. Sheldon Brown (may he rest in peace) is your friend.
http://www.sheldonbrown.com/bbsize.html
You will also find that you probably can’t fit road cranks to an MTB as there won’t be enough clearance for the chainrings (at least I did :-)