Yes dogs can safely eat raspberries as well as strawberries.
Strawberries and Raspberries are very healthy for your dog to snack on but shouldn't be used as a sole source of food for them.
I feed my dog some raspberries and strawberries along with his regular food or as a snack throughout the day and he loves both raspberries and strawberries and has been eating them for around 4 years now.