Knocking on wood, or to touch wood, refers to the apotropaic tradition in western folklore of literally touching, tapping, or knocking on wood, or merely stating that you are doing or intend same, in order to avoid "tempting fate" after making a favourable observation, a boast, or declaration concerning one's own death or other unfavorable situation beyond one's control. The origin of this may be in germanic folklore, wherein dryads are thought to live in trees, and can be invoked for protection.
In old English folklore, "knocking on wood" also referred to when people spoke of secrets – they went into the isolated woods to talk privately and "knocked" on the trees when they were talking to hide their communication from evil spirits who would be unable to hear when they knocked. Another version holds that the act of knocking was to perk up the spirits to make them work in the requester's favor. Yet another version holds that a sect of Monks who wore large wooden crosses around their necks would tap or "knock" on them to ward away evil.
In Romania, there is also a superstition that one can avoid bad things aforementioned by literally knocking on wood ("a bate în lemn"). Wood tables are exempted. One of the possible reasons could be that there is a monastery practice to call people to pray by playing / knocking the simantron.
In Bulgaria the superstition of "knock on wood" (чукам на дърво) is reserved for protection against the evil, and is not typically used for attracting good luck. Usually people engage in the practice in reaction to bad news, actual or merely imagined. In most cases the nearest wooden object is used (in some areas, however, tables are exempt); if there are no such objects within immediate reach, a common tongue-in-cheek practice is to knock on one's head. Knocking on wood is often followed by lightly pulling one's earlobe with the same hand. Common phrases to accompany the ritual are "God guard us" (Бог да ни пази) and "May the Devil not hear" (Да не чуе Дяволът).
In Croatia and Serbia there is also the habit of knocking on wood when saying something positive or affirmative about someone or something and not wanting that to change. Frequently the movement of knocking on nearby wood is followed by "Da pokucam u drvo" (да куцнем у дрво) (I will knock on wood), or sometimes by "Da ne ureknem" (да не урекнем) (I don't want to jinx it).
In Poland, as well as in Russia, there is a habit of knocking on (unpainted) wood (which may be preceded by saying odpukać w niemalowane drewno or simply odpukać, literally meaning to knock on unpainted wood) when saying something negative - to prevent it from happening - or, more rarely, something positive - in order not to "spoil it".
In Turkey, when someone hears about a bad experience someone else had, he/she may gently pull one earlobe, and knock on a wood twice, which means "God save me from that thing."
On an episode of the American TV show The Rifleman, first aired 11/05/1962, an Irish female character stated 'knocking on wood' was done to alert Leprechauns that a good deed was needed by the person doing the knocking.
Alomancy, related to throwing salt over the left shoulder
^Reference.com Origin of Knock on Wood The origin of knocking on wood for this purpose is believed by some to be from early pagan mythology. Wood gods, or dryads, lived in trees, and people would go to them for blessings and to prevent bad luck.
^Touch Wood for Luck The History & Superstition of 'Touch Wood' One explanation states that the tradition derived from the Pagans who thought that trees were the homes of fairies, spirits, dryads and many other mystical creatures. In these instances, people might knock or touch wood to request good luck, or to distract spirits with evil intentions. When in need of a favour or some good luck, one politely mentioned this wish to a tree and then touched the bark, representing the first "knock." The second "knock" was to say "thank you." The knocking was also supposed to prevent evil spirits from hearing your speech and as such stop them from interfering. Alternatively, some traditions have it that by knocking upon wood, you would awaken and release the benevolent wood fairies that dwelt there.