The only things needed to know the rules of a particular card are just [a rulebook](https://assets.pokemon.com//assets/cms2/pdf/trading-card-game/rulebook/sm6_rulebook_en.pdf)<sup>[1]</sup> and the card itself.

Regarding _EX_ cards, there's nothing written on them about limiting them to one per deck so this rule from rulebook applies<sup>[1]</sup>:

> When you are building a deck, you can have only 4 copies of a card with the same name in it, except for basic Energy cards.

Also the text _"Evolves from X"_ on Evolution cards (= not Basic) is important because it's the name of the card you can only play the Evolution card onto. In your case, Lucario-_EX_ is Basic, _M_ Lucario-_EX_ is Mega evolution that "Evolves from Lucario-_EX_" so you only need Lucario-_EX_ in play to be able to evolve to _M_ Lucario-_EX_, any other combination won't work<sup>[1]</sup>.

![Lucario-EX](https://i.sstatic.net/I93Ac.jpg)![M Lucario-EX](https://i.sstatic.net/c63z5.jpg)

In the rulebook there are appendices for both Pokémon _EX_ and _Mega_ Pokémon explaining the rules that are written on the cards if you'd like to know more.

In tournament, as long as you have at least one Basic Pokémon card in your deck, you can't be punished for playing an impossible evolution cards (like Riolu+Lucario with _M_ Lucario-_EX_), you would just have cards in your deck that you are not able to play under any circumstances (you can't put _M_ Lucario-_EX_ into play without Lucario-_EX_). On the other hand, don't forget to check the actual format of the tournament, all premier events nowadays use either Standard format (Sun & Moon and newer) or Expanded (Black & White and newer)<sup>[2]</sup> and your _M_ Lucario-_EX_ is legal only in the latter one. If you showed with _M_ Lucario-_EX_ on a Standard event, than you would really have an illegal deck<sup>[3]</sup>.

As you pointed out, the difference between Pokémon _EX_ and Pokémon _GX_ is that the former ones are always Basic whereas the latter ones are always the stage they are supposed to be<sup>[1]</sup> (except for _Tag Team GX_ cards which are also always Basic). However this difference is conceptual and has no impact on the game itself. You just read the cards and you are fine.

---

<sup>[1]</sup> [Pokémon Trading Card Game Rules (Sun & Moon rulebook)](https://assets.pokemon.com//assets/cms2/pdf/trading-card-game/rulebook/sm6_rulebook_en.pdf)  
<sup>[2]</sup> [Play! Pokémon TCG Rules and Formats](https://assets.pokemon.com//assets/cms2/pdf/play-pokemon/rules/play-pokemon-tcg-rules-and-formats-en.pdf)  
<sup>[3]</sup> [Pokémon TCG Penalty Guidelines](https://assets.pokemon.com//assets/cms2/pdf/play-pokemon/rules/play-pokemon-tcg-penalty-guidelines-en.pdf)