1. Your dog's diet matters. Low quality food can cause skin and ear problems.
2. Choose a dog with prick ears (ears pointed up) as they are less prone to infection.
3. Use a homemade solution of warm water mixed with vinegar for rinsing rather than solutions with chemicals.
4. Never squirt liquid directly into your dog’s ear. Instead, apply to cotton ball and then wipe.
5. Over-cleaning your dog’s ears can cause irritation. Only clean once a week unless your dog has symptoms of an ear infection.
Source: Ear Care For Dogs