Nobody knows where the English word dog comes from. It turns up in Old English as docga, of uncertain origin, and Wiktionary’s best guess at the original meaning is a common dog, as opposed to a well-bred one, something like “cur”. It may be a pet-form diminutive, like the words behind frog and pig, on a base nobody can identify. The most familiar animal in the language has a name with no family at all.
The word that won
It was also not the word you were supposed to use. In 14th-century England the general word for a domestic canine was hound, and dog referred to a subtype. That older word is the one the rest of Germanic kept: German Hund, Dutch hond and Swedish hund all say it, and English has narrowed it to the hunting kind. The insult won. The surprise is that Spanish did the same thing independently. perro is first found around 1200, also of uncertain origin, and it also meant “cur”. It had a pejorative sense, and it soon began to supplant the Latin word. Perhaps it came from a call used for dogs. Portuguese cão, French chien and Italian cane kept the Latin, and so two languages at opposite ends of western Europe ended up calling their dog a mongrel.
Under all this lies one of the oldest words on the map. Proto-Indo-European *ḱwṓ is behind Latin canis, Ancient Greek κύων (kýɔːn), Sanskrit श्वा (ɕʋaː), Welsh ci and Armenian շուն (ʃun). Canine comes from it, and Wiktionary lists hound as a doublet of canine, so the hunting dog and the pointed tooth are one word by two roads.
Back from a cousin
Russian looks as though it has nothing to do with this, and it has everything to do with it. собака (sɐˈbakə) comes from a Middle Iranian word, *sabāka-, from West Iranian *spaka, and ultimately from that same *ḱwṓ. So Russian borrowed its own family’s word back from a cousin. Persian سگ (sæɡ) sits on the same line. The other Slavic word survives next door in Polish pies, Czech pes and Croatian pas.
Some names wander. Hungarian kutya looks Uralic, but Wiktionary thinks it more likely a wanderword, with similar forms across Eurasia. Turkish köpek goes back to Proto-Turkic, and one explanation offered for it, with a straight face, is kelebek, “butterfly”. Arabic كلب (kalb) and Hebrew כלב (ˈkelev) carry a Proto-Semitic *kalb-, with Akkadian kalbum beside them.
Two words
East Asia keeps two words. Mandarin 狗 (koʊ̯˧˩˧) is written with 犬 on the left, for meaning, and a sound element on the right, and in Japanese 犬 (inɯ) it is 犬 itself that is the everyday word. The Mandarin word has a dictionary sense of “contemptible person”, and so do its neighbours elsewhere: Turkish köpek is also a scoundrel, Russian собака a cur, and Spanish perro something ruder. Thai หมา (maː˩˩˦), Korean 개 (kɛ) and Vietnamese chó have words of their own. In language after language, people use the name to insult one another. In English and Spanish, the insult seems to have come first.