I don't like either. An individual dog might be an individual man's best friend, but "the dog" as a category of animals is not the same thing.
If you are speaking about a specific dog and a specific man, then it is possible to say "The dog is the man's best friend". If you are speaking about a specific man (but haven't yet mentioned a dog), then you could say "A dog is the man's best friend". This is rather an unlikely scenario, but it is grammatically correct. If you are talking about a particular dog but have not yet mentioned a man, then you could say "The dog is a man's best friend", but this is even less likely than the previous sentence.
The usual forms of the expression are:
A dog is a man's best friend. [Both the dog and the man are representative examples of their species, not individual animals]
Dogs are a man's best friend. [Dogs in general and a representative man]
Dogs are man's best friend. [Dogs in general and mankind as a species]
I have not seen a gender-neutral version of this saying. But that makes sense to me. Traditionally (in the US) males like dogs, and females like cats.
So the choice of animal for a life-long pet (a "best friend") is not gender-neutral. It is unusual for a male (who lives alone) to have cats. It is less unusual, bit still a little unusual, for a single female to have a dog.