This is how the Indominus Rex freed the eight Legendary Pokémon in War of the Apocalypse.

(The Indominus Rex is looking for someone to escape untill he sees a door and decides to ram it. Meanwhile all the villains watches the Indominus Rex in the captive room where they kept Legendary Pokémon)

Foolscap: Oh, no!

Attila: How is that blasted beast doing that?!

Hun: It's entering the captive room!

King Nixel: Oh, no! The captive room has eight Legendary Pokémon we captured them!

Major Nixel: Do something!

Shredder: Stop it before it frees all Legendary Pokémon!

(The Indominus Rex roars, attacks and defeats the Nixels, Team Rocket Grunts, Rahzar, Tiger Claw, Fishface, Bebop and Rocksteady. It steps on the machine and frees Kyurem, it fires Ice Beam freezes one of the propellers on the Tandem Rotors. It swirls out of control and crashes into the machine and exploded as Indominus Rex makes a run for it, the orbs shuts off and frees Groudon, Kyogre, Tornadus, Thundurus, Articuno, Zapdos & Moltres. The Bird Trio, Tornadus and Thundurus flies off while Kyurem and Groudon walks and Kyogre swims to escape)

Tirek: No!

Major Nixel: The Hybrid Dinosaur freed all of the Legendary Pokémon we've captured!

Dr. Eggman: I can't believe this!

Bowser: Indominus Rex! How could you?!

Adagio Dazzle: Great! First Indominus got loose! Now it free eight Legendary Pokémon we captured! Without our army of Legendary Pokémon, Tino will never join us!

King Nixel: Enough, we need a Plan!

Mr. Ross: We'll recapture them and control them again!