You cannot get Legendary Pokémon in Warcraft III.
They do not crossover. To catch Legendary Pokémon, play a Pokémon game (Pokémon GO, Scarlet/Violet, Legends: Arceus, etc.).
If you meant a custom Warcraft III map (e.g., a Pokémon-themed mod), specify the map name for relevant help.