Hamburg and Nuremberg (not Nuremburg, too close wording to Nürburg) are culturally and by style very different cities and a few hours of train / car traveling away from each other. So, in an itinerary context they are not just replaceable.
Funny-wise Nuremberg still has a "Burg" castle, Hamburg not.
Hamburg is Germany's second largest city and is a metropolis which belongs more to the Scandinavian world. The international port plays a huge role. For history fans day trips such as Lübeck, Stade, Lüneburg or Schwerin are worth exploring because Hamburg does not have an own old town. A former WWII bunker is a hotel now. Submarines of these times are also in reach by day trips (Laboe, Bremerhaven). Former c-camp Bergen-Belsen can be visited. The Miniatur Wunderland is #1 tourist attraction in Germany (voted by tourists). For music fans the Elphi is worth booking a classic concert. The new HafenCity has established a lot of new quarters in former port-related areas.
Nuremberg offers a lot of history impressions from various epochs. It also has an old town and fulfills more the stereotype of an older German city. In general Southern Germany has less war related places / items but of course some Nazi history. Day trips to Bamberg, Bayreuth or Regensburg have positive responses in the forum. Compared to Northern towns which have more a red-brick architecture and style Nuremberg has a more classic town style, also with half-timbered houses.
For Nazi terror impression the Topography of Terror in Berlin is a recommendation.
Hope this helps.