Standard rm (coreutils) has included rootfs protections since at least 2012:
--no-preserve-root
do not treat '/' specially
--preserve-root
do not remove '/' (default)
https://manpages.debian.org/stretch/coreutils/rm.1.en.htmlMind that if your rm comes from elsewhere (say, Busybox), it may not have that protection.
Very careful use of rm as root is an excellent habit to cultivate.
As are backups.