One well-known unofficial service pack for W98 steals many elements from WMe, so I would consider it completely illegal if one doesn't have a WMe licence.
Then, Microsoft alleges that decomposing and recomposing software isn't allowed by their so-called licence agreement. However, the licence agreement isn't the law, and several courts in the EU have decided against the so-called agreement.
So modifying W98 with pieces written by yourself (like painting new icons, programming a stable VMM...) is very probably legal and little risky. Complete forums exist for that.
I don't have 98 disks lying around... I left it far behind once XP was released. I have tried any of these so-called "service packs", so I would be unable to tell you if they are actually useful. As far as legality, it's extremely unlikely MS would care about Windows 98 anymore.