Theatrical types are well known for their belief in superstitions, or at least for their willingness to make a show of pretending to believe in them. The term 'break a leg' appears to come from the belief that one ought not to utter the words 'good luck' to an actor.
By wishing someone bad luck, it is supposed that the opposite will occur. Other superstitions are that it is bad luck to whistle in a theatre, to say the final line of a play during dress rehearsal, or to say the name of 'the Scottish Play' (Macbeth) in a theatre's green room.