On Halloween, as the days grow shorter and the nip of winter is getting close, grinning candle-lit pumpkin heads leer from windows, and kids dressed as skeletons and witches go trick-or-treating from door to door. The veil between the worlds is thin: spirits can be invoked, and spells can be cast to divine the future. It is a time for mystery and superstition – but is there more connection with theatre than we might have thought?

The theatre profession are a hugely superstitious bunch, especially where employment is concerned. Old traditions involve actors never cleaning out their makeup box (in case they never need it again), and, if they find a thread, winding it around a finger in hope of securing a lengthy contract. Other beliefs are clearly very practical. The embargo on whistling on stage began when stagehands were moonlighting sailors – a mistimed whistle could call a heavy piece of scenery down on your head. The ban on real flowers on stage (they wilt), real jewellery (it plays havoc with lighting design), and having more than two lit candles in a dressing room (your theatre might burn down) are about as superstitious as a health-and-safety manual.

But there is still something here that taps into theatre's natural uncanniness, and the fact that it shares so much of illusion and mystery with the world of superstition. Many theatres keep a cat: these eat mice, which, if unchecked, have a tendency to eat scenery – but they are also witches' familiars. Likewise, the "ghost light", left burning upstage centre whenever the theatre is empty, might prevent someone from tripping over in the dark and breaking their leg, but also appeases theatre ghosts by allowing them to stage their own performances one night a week.

It is not surprising that the play around which most theatre superstitions circulate is Macbeth, famously the "Scottish play". It was written at a time when witches were believed in, and feared – James VI (later James I) published his own Daemonologie in 1597. One rumour says the play's three witches cast real spells, and Jacobean necromancers cursed the play as a punishment to Shakespeare. The actor Patrick Stewart suggests that, with several fight scenes and being set mainly in the dark, it courts disaster, making actors stumble and walk into the furniture. Many in the profession will not utter its name, and if anyone does so accidentally, they must undergo an elaborate cleansing ritual.

Perhaps the likeliest explanation is that, as a real crowd-pleaser, it was frequently staged to pull in the punters when a theatre was losing money – the same reason blue (a very expensive dye) was seen as unlucky, unless worn with silver, proving the company was financially in the pink. Yet other colour-based rituals take us straight back to the world of superstition: green and yellow, both frowned on, are the colours of the devil in medieval imagery. The line between theatre and magic is blurred. One of the earliest manuals of illusion, Reginald Scot's 1584 Discoverie of Witchcraft, was deliberately written to make clear that performers and illusionists were showmen, not witches. On the other hand, part of the armoury of a witch was evidently an ability to create good theatre. In 1486, the inquisition handbook Malleus Maleficarum investigated "whether witches may work some Prestidigitatory Illusion so that the Male Organ appears to be entirely removed and separate from the Body" (one for Derren Brown, perhaps?). For the stage is the mirror held up to nature, and mirrors are the most magical of objects. When Reginald Scot wrote: "you may have glasses so made, as what image or favour soever you print in your imagination, you shall think you see the same therein", he could almost be speaking of a theatre.

So, always step out of your dressing room on your left foot. Never look at the audience from the wrong side of the drop curtain. Be sure to put your makeup on with a rabbit's foot. Don't knit in the wings (presumably in case you accidentally impale Patrick Stewart coming off as Macbeth). Perhaps on Halloween, when the veil that separates the worlds is especially thin, we might do well to obey the superstitions that adhere to that thinnest of veils: the stage curtain.