If it's their own computer, what better way for them to learn than by making mistakes? And if it's a shared computer, Linux container tools (e.g. https://github.com/containers/toolbox) would let them "sudo rm -rf /" in their own environment without jeopardizing the base system or other users.