Yes it is very possible. Usually to get something out of the ear, sedation is needed because dogs do not hold still for that.
Again, head shaking is because of irritation of the ear, that's the number 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 causes. The question should be what is causing the irritation, be it hair, cyst, wart, foreign object, infection, parasites (ear mites), allergies.
It is possible to be a food allergy, but it would be due to the food you are giving, NOT the treat you are eluding to because it was given 1 month ago. For food allergy, a food trial is needed, and special diet ONLY available from your vet is needed. Food trial is an 8 to 12 week process in which you CANNOT give your dog ANYTHING BUT the special food, this includes NO TREATS WHATSOEVER. As you can see, this is a difficult process, so you need to make sure you and the family are up for this before purchasing the food. BTW, those food are expensive, usually costs at least $80 for a 30 pound bag.
Please let me know if you have any questions or concerns. Thanks.