To add onto PrimalKyogres answer, there's been a few other instances where NPCs can have shinies due to the lack of shiny lock.
For example, Wally's Ralts and Professor Juniper's Minncino. Here's a list of all examples of that:
- The Minccino that appears in the "world of Pokémon" intro in Pokémon Black and White.
- Rental Pokémon found in the Battle Factory in Pokémon Emerald.
- Battle Frontier Pokémon used by the AI in Pokémon Platinum.
- The Ralts that Wally catches in Pokémon Ruby, Sapphire, and Emerald.
- The Pokémon that the old man encounters in FireRed and LeafGreen.
- The Poochyena/Zigzagoon that attacks Professor Birch in Pokémon Ruby, Sapphire, and Emerald.
- The Purrloin that Bianca catches in Pokémon Black 2 and White 2.
- The Fletchling that the rival, Calem or Serena, uses in the capture tutorial in Pokémon X and Y.
And as an edit, also the Pokemon that Primal listed, full credits to him:
- A trainer has a shiny Exeggcute in Sun and Moon
- In the trainer tower in FRLG, Burglar Jac has a shiny Meowth, twins Jen and Kira have shiny Espeon, and Fisherman Kaden has a shiny Seaking.