To be pedantic he wouldn't necessarily have to beat ever other heavyweight to be #1. But no he would not be top dog.
Nobody would have beaten every single heavyweight before or after them. There is somebody who would have got better results vs every heavyweight before or after them, than any other heavyweight could have managed. I think that what you are really asking, is was Rocky Marciano that man? While we cannot rule the possibility out, I submit that it is unlikely. His size, and style, both suggest that other men could have been more versatile, against a range of great heavyweights.
Let me go a little further. Would he have beaten every single Heavyweight before or after him? No he wouldn't BUT the more interesting question would be: Can beat Marciano any Fighter in his own Weight Class? There was no Cruiserweight back then. Marciano would DESTROYED anybody in todays Cruiserweight division.
This. People love throwing around blanket statements like beating every heavyweight before him or after him. Every fighter has a style they struggle with and people need to remember just how many heavyweights came before and after Marciano.
Being number 1 h2h doesn’t equate to not losing to a single HW before or after. Ali is #1 h2h, no debate.