The superstition of knocking on wood traces its origins back to the ancient Romans and Greeks, who performed the ritual for religious purposes.
After a proclamation of good fortune, the Hellenes, fearful that any display of hubris could incur divine wrath, would beg forgiveness from Zeus by knocking on an oak tree. To the Greeks of antiquity, oak trees symbolized Zeus likely because of their association with lighting. Even today, oaks tend to stand taller and retain more moisture than other trees, making them arboreal lighting rods.
Over time, the custom spread across the Mediterranean to Rome, and, through the empire’s many wars of expansion, the practice was brought to western Europe. As the ritual grew in use, the rules began to loosen. First, the tree requirement was abandoned and an individual could knock on wood as long as it had been cut from an oak tree, but, as the centuries progressed, observance to this variation also slackened. Today, the significance of the oak, much like the the aim of placating Zeus, has been largely forgotten, and wood of any sort will due.