Yes, you can. Just like the answer about peanut butter above, some dogs can be allergic to things like gluten found in regular flour. Whole wheat flour can have some more nutrients which is always great, or you can use an alternative flour like coconut flour. I always recommend letting your dog sample a small amount before giving them lots of treats, because dogs can be allergic to anything, just like people!
Facts are important, Debi, but this article on “naturalsociety.com” does not provide any. It cites minimal references, none of which actually describe a definitive link between peanut consumption and cancer. I would instead refer to peer-reviewed literature, like this article http://jn.nutrition.org/content/138/9/1757S.full.pdf+html, which indicates that the relationship is unclear, but possibly beneficial.
I was just reading the above comments. If a dog needs to be wheat free oats are generally not a good idea to use unless they are gluten free oats or oatmeal. Of course every dog is different. But with people who either have wheat sensitivities (gluten) or Celiac’s you can’t eat any type of flour and it includes the oats too. My dog has wheat issues and she can’t touch oatmeal anything :( Try in moderation for your dogs.