If they're what I think they are, the food is still edible... but I would bag and freeze it to kill any little crawlers that remain, as well as cleaning all your storage and handling areas with a bleach water solution.
The adult moths lay eggs on the grain while in the field. Usually, the cleaning, dehusking, and cooking your dog food goes through in being formed into kibble removes or kills all the eggs, but not always. You only get hatchouts in food that has been mishandled somehow... often in shipping/warehousing.
If you don't already do so, make sure YOUR handling is right. Store your food in airtight containers (open) or in the original packaging (closed). Keep food in a cool, dry place as humididty and warmth encourage the little monsters to hatch. Keep only about a month's supply of food on hand at a time. If you have to buy larger quantities, freeze all but the amount that will be fed immediately. Keep any other seed or grain-based product away from it (it's common for the larvae to begin in something like wild bird seed, which isn't cleaned or cooked well--if at all.)
Even though they won't hurt the dogs, you definitely want to get rid of them. They eat a lot of food, reproduce rapidly, and spread through everything.
Good luck with your infestation!
Beth