Excess moisture is a common cause of ear infections, so be sure to thoroughly dry your dog's ears after swimming and bathing. If your dog is prone to chronic or recurrent ear infections, identifying and managing any underlying causes such as allergies can help prevent new infections from occurring.