It's usually safe for dogs to eat peanuts, although like humans, some may be allergic. Peanut allergies aren't as frequent or intense with dogs, but it's still important to be cautious and aware.
Because peanuts contain a significant amount of fat, peanuts and peanut products should only be given to dogs in moderate doses. Salted or shelled peanuts shouldn't be given to dogs. Raw or roasted peanuts are safe. Creamy peanut butter with low sodium is also a safe treat.
Most nuts are not harmful to dogs, but they should be given very modestly. Macadamia nuts should be strictly avoided because they are highly toxic to dogs.