The type of surface you run on affects the amount of force that is transmitted up through your legs into the rest of your body. Running on a softer surface is easier on your body. The ranking of hardest surface to softest is as follows: cement (sidewalk), pavement (road), dirt (trails), grass and, lastly, sand. You can get running shoes specific to road running and trail running.
Road running shoes are designed for the everyday surfaces that would typically be encountered city runs with the occasional trial or dirt path. A trail shoe is a road running shoe that has been toughened up. The trail shoe provides more stability for your ankles on uneven surfaces; it includes better traction through the sole to prevent slipping on things like mud or slippery tree roots. The trail shoe also has a rock plate between the sole and your foot, designed to minimize the risk of rock bruises. They are also more water repellant than a typical road shoe.
A road running shoe can be used on trails and a trial shoe can be used on the roads, but the relationship isn’t exactly equal. You will find it much easier to run on trails with your road shoes than to run on the road with your trail shoes.