I see them advertised as being good for one or the other. Is there really a difference? Or is it just a marketing gimmick?
The biggest difference is strength. There are some road stems that will say they are not recommended for downhill/freeride type riding, but are ok for cyclocross. Road stems will also come in a larger range of angles.
Just be sure that when you are looking at stems, you match the clamp of the stem to your steerer tube (1" or 1 1/4" usually) and to the diameter of the bars that you are using.
Whether 1" or 1 1/8" stems there is no difference.
"Road stems" typically have more shallow rise (between 6 degrees and 20). "MTB stems" typically have more steep rise (between 17 degrees and 35).
Of course the materials can be different and you want to choose the correct materials for your application, but most modern threadless systems have identical steerer tube size (1 1/8") and handlebar clamp size (31.8mm).