If course it doesn’t say any such thing in the Koran. It’s from an alleged saying of Mohammed. I would ask any Muslim who has a problem with dogs why is he worshipping Mohammed when he’s supposed to be worshipping Allah/God.
There is no God but Allah and Muhammad is his prophet.
Thus anything he says is supposedly coming from Allah himself and to be followed as the word of Allah. This is how they justify their actions by following whatever this whacked out pervert rapist did.