From the story I heard from my German language teacher in high school, and IIRC -
Hamburgers were invented in a German city called Hamburg. Since they were invented there, they decided to name the tasty new treat in honor of the place that birthed it, hence Hamburg-er
The “ham” in hamburger is purely coincidental.
Similar things happened with other German cities, for example Frankfurt begot the Frankfurter, and Berlin the Berliner. You may of heard of the famous presidential gaffe that occurer in Berlin one day…Ich ben ein Berliner
Actually, to be fair, the only cite I have for the Roman burger being between bread is this partial transcript of a program called Hidden History (with Terry Jones). Still, the burger itself is an established fact.
It’s not only German, lots of food is named after the place where it’s made or where it originated - Bologna sausage, Cheddar cheese, Mayonnaise, Béarnaise sauce etc., etc.
I’d also add such things as Parma ham, Dijon mustard and of course Stilton (which in fact was never made in Stilton - that’s just the town on the main highway where it was sold to travellers).
I wonder how many people outside (or even inside) the UK realise that, say, Cheddar cheese is named after a town. As for mayonnaise, I only learnt a few months ago that it comes from sauce mahonnaise, meaning sauce from Mahón (a port on the Spanish island of Menorca). I guess when words become that common we tend not to think about where they come from.
As for “hamburger”, while it’s true that the “Ham” in Hamburg is just a coincidence, it has inspired the word “beefburger”, which in the UK at least tends to refer to the meat patty itself, while “hamburger” applies to the whole thing in a bun. Is this also common usage in America?
On the other hand, here in the States, we do have “turkeyburger” for ground turkey meat, as well as “soyburger”, “milletburger” or “veggieburger” for vegetarians.