dangerous?
Not necessarily.
A properly manufactured, undamaged charger that meets applicable safety standards is generally designed to remain connected to an outlet during ordinary use. It would be misleading to suggest that every idle charger is likely to catch fire.
However, remaining connected means the adapter and its electrical connection are still part of the energized circuit. Unplugging it when it is not needed can remove that particular source of risk.
This is especially sensible if the charger is old, has been dropped repeatedly, has questionable manufacturing quality, or is