Obviously, they are safer. No chance at all of getting hit by a car or mugged or bitten by somebody else's dog while you are walking on the treadmill.
Not that they are perfectly safe. People have gotten hurt on the things. Nothing is perfectly safe.
But the problem with treadmills is that they don't duplcate the exercise you get while actually walking, running, or jogging. Here's why.
When you walk, jog or run, you are pushing your body forward. Glutes, hamstrings, and calves are involved.
With a moving treadmill, the track is moving, and all you have to do is pick up your feet and move them forward then let them be moved back by the treadmill. So the muscles you exercise tend to be those involved in bringing the leg forward, not in pushing your body forward.
This is why some say that treadmills and power steppers and so on can create muscle imbalances. Which IMO is another reason to exercise in different ways and not just one.
But there is another way to exercise on a treadmill that I want to share: The track will move when the machine is off if you push it your feet. Try it. (Helps to adjust the track so you are going somewhat uphill.) Takes a lot more effort, huh? While I can't keep it up for long, it is a good exercise, for intervals for example.