Dogs can experience allergic reactions to environmental factors, leading to coughing and gagging. Identifying these allergens and managing exposure can alleviate their symptoms and improve their overall well-being.