Freezing a hard drive will damage it.
The condensation from the frozen hard drive that builds up as it thaws will destroy the hard drive and the circuit board when it warms up.
When a hard drive gets to below freezing the metal pieces also contract and create more space in the hard drive and create the risk of misalignment in the drive.
And if the platters and heads are misaligned in the hard drive, then running it can cause the hard drive to fail.
For a solid state hard drive those would also be damaged from freezing due to the condensation that would short out the circuit boards and circuits when powered on.
Allowing a hard drive to get cold won't damage it even if it is in freezing cold temperatures.
But if you place the hard drive in the freezer then it will allow moisture to buildup in the hard drive.
If the read/write head comes into contact with the ice crystals, it can also physically damage the hard drive platters, leading to permanent data loss.
And the sudden temperature change can also stress the circuit board on the hard drive, potentially causing further damage.