As I recall, only monsters get those. There are no sample NPCs in the Monster Manual who get legendary actions, lair actions, or legendary saves. That's why they're fair game. There's nothing that an NPC can do that isn't just a greasy mirror reflection of what a PC can do, but monsters represent a different reality entirely.
If I'm playing my level 17 wizard by the PHB rules, and I come across an NPC archmage who can break those rules in obvious and significant ways, then I'm going to call shenanigans.