Some companies do give away out-dated versions of their software (in the hope you will pay to upgrade). But Microsoft is not known for being flexible in copyright matters, for example you don’t ‘buy’ software from them, you ‘license’ it, so they can get around ‘fair use’. So technically, it is illegal.
Why do you want Windows 98 ? Do you have an old computer ?
I have a legal copy of Windows 98 first edition that is unused (or should I say unusable!). Seriously, it works, and you are welcome to have it. PM me if you like.