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.
The answer is not by default.
Let me add that the risk can be more subtle than your bare-bones example. Take this example:
The accidental space between the
That's why you need to be extremely careful when using