B. "Pants" can mean that the dog is breathing fast or that it is wearing a clothing item that covers its lower body.
This is humorous because the word "pants" can refer to both the act of breathing heavily (which a dog might do after being active) and to a piece of clothing, creating a playful ambiguity in the statement.