Do any Linux distros prevent the execution of
sudo rm -rf /* so that people do not accidentally delete their hard drives if they did not know what they are doing?
No; you are expected to know what you are doing. Look on the bright side! You almost certainly won't shoot yourself in the foot more than once.