St Dunstan, Archbishop of Canterbury in 959, is thought to have begun this belief. Dunstan was a blacksmith, and when the Devil asked him to re-shoe his hoof, he nailed a horseshoe to it and caused him great pain. Dunstan agreed to remove the shoe on the condition that the Devil never entered a place where a horseshoe hung above the door.
Verdict
Common sense might suggest this is a load of old nonsense. Then again, have you ever seen the devil appear in a place where they’ve had a horseshoe hung up?