Yes, they can eat them along with their other foods.
actually they cannot, the above answer is wrong, i have a rat myself and have been doing lots of research and it is on lots of website that they cannot eat raw dry beans or peanut as they contain antinutrients that destroy Vitamin A and enzymes needed to digest protein and starches, and causes the red blood cells to clump.t
Rats should not eat raw peanuts. They can eat cooked peanuts. It is actually found in some foods like nutriphase. In small doses, cooked peanuts are okay. Peanut butter is safer. There are so many other foods out there, its easier to just avoid peanuts.