It's best not to run on the road with headphones on. Listening to music detaches you from your surroundings and makes you far more vulnerable to being attacked or being hit by a car.
In the gym...well, personal preference is the order of the day. Lots of people seem to run fine with headphones on. I thought I'd find music helpful on the treadmill, and the canned music in the gym isn't a problem now I go to a gym where it's not played at top volume, but after the first couple of minutes I have to take the headphones off because the rhythm of the music starts to fight with the pace of my legs and lungs.
I do like to listen to music or watch TV when I'm on the step machine, though.