Dogs will sometimes do this due to dental tartar build up or infection. You can check her teeth for tartar build up, discoloration, red or bleeding gums as possible signs of that.
While you are checking the mouth, if your dog's tongue or gums look pale, blue or yellow tinged where they normally look pink, or have a slow color refill (it should be close to instant) when you press on a pink area this can be signs of other health issues such as liver or kidney problems or heart issues etc. Those signs indicate she needs vet care soon.
Other reasons for teeth chattering and head shaking can be a problem in the neck area causing difficulty with nerve controls. You can read about disc issues in the neck here
and more here
You might also see this if the nerve running around the head and near the inner ear is impacted by inflammation in the ear from infection or allergies.
Sometimes a toxin such as an insect poison can cause this. If you just used over the counter flea drops with say permethrin in it that could be the issue.
I'd plan a vet visit for your senior dog.
If she gets worse you may want to see an emergency vet.
This site may help you locate an emergency vet if you need one
Or plan a senior check up with your regular vet if it doesn't appear to really bother her or get worse.
Hope this helps you!