I would take the dog to the vet to rule out ear mites or infections.
On all our cats, we have used tea tree oil (used in Australia as an anti-bacterial for animals and which you can buy at the health food store).
Once a month we swabbed the inside of their ears with as q-tip dipped in the oil. It would sting and they would fight us but with a lot of kisses and praises the cats would eventually forgive us.
Never again had a problem with their ears (we had 9 at the time and 2 had ear mites)
You will feel better after the visit to the vet.
You can also get rid of ear mites with a squirt bottle filled with 1 part vinegar to 2 parts water.
Try Neem oil instead.
Works better and isn’t toxic like tea tree oil is.