Good Day Ramya....
Thank you for the questions, I am sorry to hear that your Pug could be having difficulties while walking. I LOVE Pugs, they are so adorable! Your Pug is a "Flat-Nose" breed and special care always needs to be taken with the "Flat-Nose" breeds such as; no extreme heat or cold weather, no overdoing it on the exercise program and keeping their walks short and sweet.
Your Pug could be suffering from stenotic nares (pinched nostrils) which could be contributing to him having a difficult time breathing. Also, if your Pug has any type of heart conditions (heart murmur or heart-worm) or seasonal allergies these could also be a contributing factor. I would consult with your vet to make sure your little fur kid doesn't have any of these health issues going on besides him just having a "Flat Nose" and special care will need to be taken while on your walks....limit them to 10-15 minutes at a time, cool weather and a leisure walk (no running for your little Pug).
Please keep me posted to what your vet says.