Aspirin can be used in appropriate doses in a healthy dog. I would not use this medication without consulting with your veterinarian. Also aspirin will not solve the problem. The underlying cause of the ear pain needs to be diagnosed or treated or this will be a recurrent problem.
It might help, but you might want to confront your vet first.
They actually make doggy aspirin, you can purchase OTC at any major pet store.