There are a couple of things I know that can cause this 1-ear mites 2- ear infection yor yeast infection - 3- seziure- as well as other these are first that come to mind.
I would call and make appt with your vet and have the vet take a look for any of these reasons your dog will need to be treated .