According to the American Heritage Dictionary, the term "hamburger" comes from Hamburg steak, which was first recorded in English in 1884 but was probably used much earlier. A form of pounded beef called "Hamburg Steak" was common in Hamburg in the middle of the 19th century.
The recipe was brought to North America by the large numbers of people emigrating from Germany at the time, many of whom passed through the port of Hamburg. There is indirect evidence for its use on an American menu in 1836. The form hamburger steak first appeared in a Washington state newspaper in 1889. The first recipe close to the current idea of a hamburger, using ground beef mixed with onion and pepper, dates from 1902.
The Oxford English Dictionary of 1802, on the other hand, defines "Hamburg Steak" simply as cured beef. In a time without refrigerators, when it took weeks to travel from Europe to the USA, cured meat was a standard food for poor US immigrants, who often started from Hamburg (which was and is the biggest German seaport and one of the biggest in the world). In a tween deck, where cooking is nearly impossible, cutting tough cured beef into pieces and putting it between slices of bread may suggest itself.