101.1. Whenever a card's text directly contradicts these rules, the card takes precedence. The card overrides only the rule that applies to that specific situation. …
101.2. When a rule or effect allows or directs something to happen, and another effect states that it can't happen, the “can't” effect takes precedence. …
609.1. An effect is something that happens in the game as a result of a spell or ability. …
205.4e Any instant or sorcery spell with the supertype “legendary” is subject to a casting restriction. A player can't cast a legendary instant or sorcery spell unless that player controls a legendary creature or a legendary planeswalker.