Peeling paint itself is not dangerous but when peeling paint becomes dangerous it's because of the paint containing led or other dangerous chemicals.
It also only becomes dangerous if you either breathe the particles or paint chips in or you actually ingest the peeling paint such as if a young or small child puts the peeling paint into their mouths.
Then if it's led based paint the child could become sick and possibly cause death.
I would recommend removing the peeling paint anyway if you can because it just looks bad and repaint the surface.