I am most familiar with a third version: Dog is man's best friend.
I don't know what "correct" means when talking about idioms. Sometimes there is more than one version. If they are used, they are "correct" as colloquial speech. They may or may not please grammarians, but people do not adopt colloquial speech patterns for the benefit of grammarians.
I would suggest googling if you really want to know: put the exact phrasing in quotes and see what numbers turn up. Me, I would have said 'A dog is man's best friend', but it could easily be 'a man's', and 'the dog' works too. Often idioms have exact, fixed wording and you just can't change it without it sounding wrong, but in this case the variations all sound okay.
And remember what Groucho Marx said: Outside of a dog, a book is a man's best friend. Inside a dog, it's too dark to read.