Yes dogs can safely eat ice cream in moderation.
Whenever I have some ice cream I also treat my dogs to a few scoops of ice cream as well and it's a good treat for them.
They sell dog ice cream which is basically just regular ice cream but sold for dogs so there's no issue in giving dogs the same ice cream that you have yourself.
Just don't give your dog chocolate ice cream because the chocolate ice cream could be poisonous to the dog and make them sick or even cause death if they eat enough of it.
But all other ice creams that are not chocolate ice cream is safe for dogs to eat.