Yes, stress and fear can cause heavy breathing in dogs. Anxiety causes muscles to tense up, including the chest muscles used for breathing. This makes it difficult for your dog to take deep breaths and can lead to rapid or labored breathing.
If you notice any signs of distress in your pet, talk with a vet about ways to help reduce their anxiety levels.