A varied diet is best for rats. Dog food is cheap and easy to get ahold of, but ideally it should be mixed with vitamin supplements and veggies as well. It probably wouldn't negatively effect a snake, honestly, unless the diet was high-fat and the supplier is putting out obese rats. Enough overweight rats and a snake will put on weight like that too.

Even though we feed them to our animals, rats are animals too, and they have nutritional needs just like every other animal.