Anything can be dangerous including dirt bike riding and you can still get hurt no matter how careful you're riding the dirt bike.
However when you wear the proper safety gear while riding dirt bikes then it can be pretty safe and many people including kids ride dirt bikes without ever getting injured.
If you ride the dirt bike properly or teach kids the proper way of riding the dirt bake and wear the proper safety gear then you'll be safe riding the dirt bike and have a lot of fun.