You can use almost any (certified) helmet for almost anything, almost.
After the certification for impact behavior, the big differences in different styles and prices is in ventilation, weight and coverage. MTB helmet tend to be better ventilated and have fewer zoomy looking projections than road helmets. My Limar has mesh in the vents to keep bugs out (I live in Florida, that's a thing).