So it if was legal, why were they brought up on charges in a World Court at Nuremberg and found guilty of committing war crimes, genius?
The answer isn't complicated and even a mental midget like you should understand that Germany never thought they would be defeated, and as victors they would not have paid any attention to what a world body decided. Winners make the rules and losers are forced to follow them.
Say, isn't that exactly what the winners in every Israeli war did?