The grounding wire of my socket was hit underground by a nail.

In this case, installing a leakage protector in the line can still play a role, because the action current of leakage protection is very small. If there is no leakage protection, your ground wire is useless, because the grounding area and depth are not enough, and the grounding resistance can not meet the requirements. So once there is leakage, the story of large leakage current will not work at all.