Is mountain bike good for long distances?
10-15 km is not a particularly long distance. You can certainly ride and MTB on roads to commute to work. Obviously an MTB will not be as efficient to ride as a bike designed for road use (such as a flat-bar commuter, road oriented hybrid or drop bar road bike).

You can make your MTB more efficient by fitting narrower tires with a road tread (or no tread) and inflating them to the higher end of their pressure range.