A beagle is a type of dog. A mongrel is a dog that results from the crossing of different breeds. To mutter is to say something in a low or barely audible voice. A mutt is a dog, another word for mongrel. We see "mutt" in "muttered". The joke is centered around the word "muttered" because we can see the word "mutt" in it and the joke is about dogs.
That ' s no beagle ; that ' s a mongrel , Tom muttered .