I meant to say, male dogs will do this, whether or not they are related to the female. And also I think female dogs do it too. I found mine doing it once with some pee scent she'd found.
thank you for your very informative reply, this has been very helpful.
This is perfectly normal and won't harm them at all. Most male dogs who have any interest in females (whether they've been neutered or not) do this. They are 'scenting' the female's hormonal condition. You might notice that they 'tremble' their mouths when they do this. They are 'tasting' the scent by doing this. It might look weird to humans, but makes perfect dog-sense. And is normal, nothing to worry about.