Anyone that 1) can reliably force approaches and/or reliably approach to punish mistakes very easily, and 2) actually has good OoS options, traps, evasiveness, etc. In my opinion.
I personally view defensive play as simply playing to minimize risk rather than maxing reward. If a character can make it far just by forcing easy reactions from most of the cast and punishing them while not being forced into much themselves, I'd say the character is strong defensively.
Using your examples, Megaman and Duck Hunt can easily rack damage on opponents, but if they need to gain a lead quickly or need to end a stock, they have to take more risks or simply hope for a lucky hit like Megaman's Fsmash when the opponent cannot punish it or DH's neutral B killing.
Rosalina can rely on Luma to rack up easy damage and force virtually braindead traps for her opponents if she plays well, and a lot of her attacks are disjointed and/or have high priority. Since Rosalina is an easier character without Luma, you'll generally find that she won't have any problems forcing approaches from anyone, because everyone wants to play with more aggression when Luma's out of the picture, and Luma forces reactions anyway.
Sonic can easily get leads and hold them for a while with hit and run tactics. I would argue that a patiently played Sonic is a terror to deal with. YMMV
Zelda is the perfect example of an awful "defensive" character. She has no way to force approaches, even if the opponent lacks a projectile, and using her projectiles to force an approach can open her up to punishment from a fair bit of the cast. She is probably the worst character in the game when it comes to approaching the opponent, and she is forced to do this a lot. This means she can't even be played the way that she may have originally been intended (if you view Sheik as an offensive character anyway - but Sheik can also be played defensively far better than Zelda, lol). That means she fails on the first point, and you'll find that characters that can't force approaches in a normal situation that are
also slow will suffer in this game. I formatted "also" because there are slower characters that are certainly not terrible (Robin), and there are characters that generally are forced to approach in most situations that aren't totally awful (Falcon).
Zelda's trap game is amazing once she gets inside and gets going, because while her aerials are overall extremely terrible, you only need a few hits to reap huge rewards and possibly the game. Her OoS options really aren't bad, given bair is frame 6, nair is frame 6, and Dsmash/dtilt are frame 5; grab is a little slow at frame 10 but certainly usable. Also, OoS Farore's is a frame 7 hit with a frame 11 vanish, and if you can process if it hits or not in a really short timeframe, it can be nonpunishable. It's easier said than done - if you've watched @
Nairo's Zelda, you've seen him teleport horizontally on Farore's hits because the cost for guessing wrong can be a stock. Anyway, I digress... if Zelda's opponent is somehow forced to play her game, she's a pretty good character. There's just no real situation where this is going to happen.