If your dog is panting even though they have not exercised, they may be experiencing stress. Changes in bodily functions. Like people, nervous dogs may experience an increased urgency to urinate or defecate.
- Environmental changes: Any changes in a dogs home environment, changes to an environment where they have begun feeling comfortable, or even changes in their daily schedule can be a source of stress for dogs.

Sudden changes in behaviour such as defecating indoors, showing signs of aggression, or physical signs such as skin rashes and excessive panting, etc. may indicate that there is an underlying physical reason that requires further investigation by a veterinary professional.

Furthermore, visual representations like the one above help us fully grasp the concept of Stress In Dogs Caused By Changes.
Stress is an altered stated of ... by physical or emotional factors that trigger psychological, behavioural, endocrine and immune effects that are designed to handle stress. Response to stress will vary between individuals and may be affected by breed, early experience, sex, age, health, and the pet's behavioural profile. In dogs and cats, exposure to mild stressors and handling early in life stimulates hormonal, adrenal and pituitary systems that result ...
Alternatively, stress signs can start to emerge with time. Stress can be caused by fear, changes in environment and routine, medical issues and/or encountering new pets and people.