It's not actually bad luck to say "Macbeth" during a production of the work. Superstition has it that it is bad luck to refer to the play by name; hence those who refer to "the Scottish play" or other phrases.
The reasoning behind the superstition is that Shakespeare used actual witches spells in the play, with the result being that the witches of his day cursed the play. As a result of the curse, productions of that play may be doomed if specifically named inside the theater, or performers involved in the production may be harmed.
In order to prevent the curse from coming to pass, those who are worried about the superstition might go through rituals involving leaving the building, spinning three times in place, spitting over one's shoulder, and uttering an obscenity.