I can see how you'd say that, but I don't really think it's necessarily the case. Having codes of conduct isn't just for lawful good, they just have a stricter code.
By default, D&D does support and encourage the Neutral, Good, and Lawful good characters and heroic style gameplay, so from that context...
Accepting the surrender of an evil villain who demands a right to trial (even though it appears to be a ploy) might be the action of a lawful good character, but a good or unaligned character might not feel compelled to accept the surrender.
Accepting a seemingly sincere surrender of henchmen for either release or capture (depending on circumstances) would probably be accepted by a lawful good or good character, and possibly by an unaligned, with a bribe and a vow to stop making trouble).
Offering an evil villain a quick and honorable death in exchange for a surrender could reasonably be done by even a lawful good or good character. You might find it difficult to find takers on this offer though.
However, demanding a surrender, with either an explicit or implicit "surrender or die", and then slaughtering them after the surrender? That's certainly not lawful good. It's not even good. I think that's even pushing it for an unaligned. That's cold-blooded killing under a false pretense, even if they deserved it. It's, as I said before, ruthless vigilantiasm.
That might be your style of play, and that's your choice, but it's just not the high fantasy heroic style adventures that I'm used to, my friends play, and is the default style promoted for the game.