Ear mites are possible, but bacterial ear infection is more likely. You veterinarian can perform microscopic analysis of the ear discharge to look for mites and for bacteria, in order the provide the correct medication.
Could this be ear mites? I do see black stuff in his ears and on the outside where the ear is infected. There is also alot of wax in his ears.
Pus and hairloss indicates skin and ear infections. I recommend that you take your dog to the veterinarian for examination and treatment; oral and topical antibiotics are likely needed. If infections resolve with antibiotics but then recur, then an underlying allergy (food allergy or pollen/dust allergies) would be the cause.