German stations do feel a bit rough - Hamburg Hbf is the only place I've ever seen someone openly injecting drugs - but you aren't likely to come to any kind of grief beyond pickpocketing, which you should watch for at any station anywhere.
I was in and out of, and through and round, Hamburg Hbf frequently over a period of nearly a week recently (using it both for trains a number of times, and for the metro, as well as for other station facilities; and staying very close by). It was a lively and bustling station at all hours (like many such big, busy, city centre stations), but I felt absolutely no more threat than at any such station in Britain (indeed, allowing for my relative linguistic and cultural unfamiliarity with Germany, it probably felt rather "friendlier" than some in Britain - and I don't think I'm especially unworldly or naive about these things).
My experience of Cologne is much less, but I did find the main concourse and passageway between platforms absolutely fine, including after dark. My main problem was the fact that the place is partly surrounded by big pedestrian-unfriendly roads, cutting you off from where you might want to go - now I did find
that a bit unnerving.
The only (non-UK) European station I've sometimes felt threatened in, and where someone once tried to rob me, was Gare de Nord in Paris; I've always found the tunnels from the main station to the RER (and the latter's platforms) reminded me somewhat of
Bladerunner. (Though rather that than the enforced trip up and down levels via a shopping mall in between trains, as being proposed for there...)