How is Hermes linked to Odin?
If we want to be exact, Hermes is not linked directly to Odin. His Roman equivalent Mercury is.
The first time such a link is made is in Tacitus' Germania, where he in the ninth book states that
Mercury is the deity whom they chiefly worship, and on certain days they deem it right to sacrifice to him even with human victims.
Human sacrifice is something that is very much linked with Odin in the later sources. Further evidence is provided through the names of the week in some of the Germanic languages, where the Roman Dies Mercurii corresponds to Wednesday, or mainland Scandinavian onsdag (The English name is derived from the spelling "Wodan").
Further attestation of the identification is through Paulus Diaconus, 8th century historian of the Lombards, who explicitly identifies Wodan with Mercury. The same identification also appears in Anglo-Saxon traditions about the missionary Columbanus.
Thus far about the source for the identification. Now for how it came about.
I don't believe Mercury was a particularly bloodthirsty god, and neither that he was the most prominent of the Roman pantheon, so obviously the identification is based on other things than what Tacitus says - it makes sense that he would focus on differences.
Instead, it seems it was several of Odin's other features that led to the identification. His wanderings have already been mentioned in comments above. Furthermore, both Odin and Mercury held some sway over the dead: Mercury acted as a psychopomp, or escort of the newly departed to the afterlife, while Odin stood to receive half of the dead that were deemed worthy (the other half wet to Freya). Furthermore, Mercury had poetry, divination and trickery as part of his domain, which are very good fits for Odin. Thus, even if the identification might seem surprising, the two gods actually have rather a lot in common (though we can not be exactly sure if not Odin picked up some of Mercury's traits along the way).
Most of the above is from, or corroborated by Gro Steinsland, Fornnordisk religion. The part about Paulus Diaconus I found in the notes of N.E. Hammarstedts translation into Swedish of Germania, from 1921, which I've also used to check the translation above.
The god Mercury (or his German counterpart) was popular among the Romanized Germans, under names like Mercurius Rex and Mercury + name of tribe/locality. It's always been assumed that this German Mercury was Woden, especially since the Romans would never have called Mercury "Rex", or king. In later times, the Germans named their midweek Woden's day, while in Latin it's Mercury's day. (As in modern French, mercredi.) I'm getting a lot of this from Michael Enright (his thesis) and Rudolf Simek's dictionary of norse myth.