Where does this expression come from? There are different reasons: some are more historical, and some are more scientific, while others are stories. Are they true or not, we don’t know.
One of the myths suggests that the ancestors of dogs gathered around the sites where humans threw their garbage, and as they did so, they let themselves be tamed, even accompanying men on their hunting expeditions. In this way, the dog became man’s best friend.
However, this suggestion, that the dog would be man’s best friend, would have been used in 1789 by King Frederick of Prussia in this sentence: ”the only, absolute and best friend that a man has, in this selfish world, the only one that will not betray or deny him, is his dog. ”  Apparently, this sentence has been pronounced in another context for the first time on September 23, 1870, during a trial in the United States, by the lawyer George Graham Vest.
Charles Burden’s dog, a greyhound named Old Drum, was murdered in cold blood by neighbor Leonidas Hornsby, who declared that it was self-defence. Charles Burden, knowing that he had lied, his lawyer, George Graham Vest, gave a speech that touched the entire audience:
“Gentlemen of the jury: The best friend that a man can have, can turn against him and become his enemy. His own son or daughter, whom he raised with love and infinite attention, can show him ingratitude. Those who are closest to our heart, those to whom we entrust our happiness and good name, can become traitors. The money that a man can have can also be lost when he needs it most.
The only, absolute and best friend that a man has, in this selfish world, the only one that will not betray or deny him, is his dog.
If misfortune leaves his master homeless and without friends, the trusty dog only asks the privilege of accompanying his master to defend him against all his enemies. And when the last act comes, and death makes its appearance and the body is buried in the cold earth, it does not matter that all the friends have departed. There, next to the grave, the noble animal will remain, his head between his legs, his eyes sad but open and alert, noble and sincere, beyond death. “
Charles Burden won his case, and Leonidas Hornsby was fined $550. 
So far, these are only suggestions that the dog is man’s best friend. However, the sentence “the dog is man’s best friend” has been written in the opening lines of Ogden Nash’s poem “An Introduction to Dogs”.
Therefore, according to all these stories and theories, the dog is man’s best friend… but your cat, your hamster or your lizard can be just as much!