I get the sonic part, but Duke isn't supposed to be idolized. He's more of a satirical anti hero than a heroic role model.
Duke Nukem is an egocentrical, over the top, womanizing badass. However, this is in an ironic sense, the most ironic sense it can be, as he is basically every 90's action star combined into one single one liner spewing being. You are right about the fact that you're supposed to laugh when he makes the jokes, but it's not because they're supposed to be funny: it's because they're ridiculous, and you think "What moron would actually say that!?", and whether we like to admit it or not, morons are funny.
This is only hightened by the fact that everything in the game has some type of innuendo to it that could only be written by someone with the maturity level of Beavis and Butthead, such as a town called "Morningwood" or a chinese resturaunt called "Noodle King" with the slogan "Until you've slurped the king's noodle, you haven't tasted anything!"
It's all funny because it thinks it's funny when it isn't, and that's what the developers intended it to be.
Now, the Sonic thing really is a good idea. A Sonic game where he thinks he's the best when nobody else does would really bring the character some new meaning.