The Walnuts themselves are not toxic to dogs so if the walnuts are shelled then your dog will be fine if they eat some walnuts.
It's when walnuts are not shelled and have developed mold on them then they become toxic to dogs and you should then take your dog to the vet if they've eaten walnuts with shells on them off the ground and especially if they had mold on the walnut shell.