Salam My Muslim Brother/Sister:
To answer your question I would like to tell you a story with Nabi Musa(a.s.). This is a long story, so be patient with me. Be sure to read ALL OF IT and don’t skim through it, otherwise you might get the wrong idea:
At the end of one of Musa’s meetings with Allah (s.w.t.), Allah (s.w.t) asked Musa to bring something/someone that he is better than to the next meeting. So Musa set off in search of this thing. As Musa (a.s.) was walking to the meeting (some time later), he found a homeless nonbeliever who was miskeen (someone who is poor and cannot change their state of poverty). So Musa (a.s.) asked him to follow him and that he will pay him for his troubles. As they were walking, Musa thought to himself “What makes me better than this man? I did not chose to be a prophet anymore than this man chose not to be one; had I gone through the same trials as this man, I might have been just like him, a non-believer.” So Musa (a.s.) concluded that there is no person better than another person. So Musa (a.s.) apologized to the man, paid him for his troubles, and Musa (a.s.) continued on his way.
Then, as Musa (a.s.) was walking, he found an old, smelly, limping dog. So Musa (a.s.) decided to bring this dog with him. He leashed it, fed it, and started walking to the meeting. As they were walking, Musa (a.s.) thought to himself “What makes me better than this dog? I did not choose to be a human anymore than this dog chose to be a dog. Nor did I choose the condition that I am in anymore than this dog chose to be in such conditions.” So, Musa (a.s.) concluded that he is not better than any of Allah’s (s.w.t) creatures. So he fed the dog again, and let him go.
When Musa (a.s.) went back to the meeting empty-handed, Allah (s.w.t) asked him, “Didn’t I ask you to bring something that you are better than?” Musa (a.s.) replied “Oh Allah, I searched and searched and did not find anything that I am better than.” Then Allah (s.w.t) told him, “Oh Musa, had you brought anything with you in regards to my request, I would have erased your name from the list of prophethood.”
Allah (s.w.t) didn’t ask Musa (a.s.) that request because there is something he is better than, it is because he wanted Musa (a.s.) to KNOW that there are no creatures of Allah that are better than another creature. All of Allah’s (s.w.t) creatures are in constant need of His Mercy. Nothing has been brought into existence and nothing exists without His permission and His power.
So, to answer your question, THERE IS NO WAY THAT MOHAMMAD (ﷺ) WOULD HAVE EVER SAID THAT!!! NEVER! He would have been saying that humans are better than dogs and we have every right to kill them. Mohammad (ﷺ) is the encompassing mercy of Allah (s.w.t.) and there is no way he would have said such a despicable thing.