There are two answers depending on what you are buying.
Pets themselves come from the Cash Shop. For everything that goes with them — food, and books listing the commands your particular pet understands — head to Henesys, where the NPC there stocks the supplies.
Getting the command book is the step people skip, and it is why their pet seems to ignore them.