It depends. If the recovery CD is an install CD, then yes. But, you still
need to have a license for the PC.
Depending on the CD, it may do a fresh install wiping out everything you
have on your system. It might have an upgrade that will upgrade your Win98
to XP, though. There really isn't any way of knowing just by what you have
mentioned.
Just make sure you do a good backup and go for it.
If the disk came with the PC, yes you can, if it's from another PC, no, that
would not be legal and probably would not work. Remember, you'll lose all
the data off the XP PC, so backup anything you need first.