Here is my response to a similar question from someone else that applies to you:
"It is most likely an ear hematoma. If a blood vessel ruptures in the ear, the ear fills with blood and becomes inflamed. It is very uncomfortable and the dog shakes its head and scratches at it. It can be medically managed, but the ear will most likely be deformed or have a shriveled up appearance at the end. This is strictly a cosmetic concern for you and not the dog. You can try medical management, but if does not resolve, it most likely needs to drained and sutured back together in a way that allows drainage and promotes healing. This condition usually occurs because the dog has some underlying pathology in the ear, whether that be an ear infection, mite, tumor, etc. Good luck!?"
Please google: Ear Hematoma and go from there......Karla