Companion pets come from several sources. Vendors sell them — the Moth Lady in Exodar, the Owl Lady in Darnassus and the Cat Lady in Stormwind are the classic starting points — and the auction house usually has whatever you are missing.
Quests reward pets too, and later expansions added pet battles, achievement rewards and a huge catalogue of collectables. If you are hunting one specific pet, check its source on a database site first; some are seasonal or tied to long-retired content.