Road bikes generally have a stem closer to 90 degrees, but there is no hard-and-fast rule. THe only reason is that many people on road bikes prefer a more stretched out position and many mountin bikers prefer to be more upright. Also, the 'look' of the straight-forward stem on a road bike is what most people are used to so they resist putting a more upright stem on for aesthetic reasons.
But most modern bikes (mtb and road) have a 1-1/8 (28.6mm?) steerer tube clamp and a 31.8mm or 25.4mm bar clamp, and so the stems are often interchangeable. There are a few other older size standards of steerer tubes and bars, though, so if you have an older bike it isn't quite so straightforward.