Backup stock HTC Desire ROM with Unrevoked
If you root or install a custom ROM you void your warranty.  It doesn't matter if you undo it.  You might be less likely to be caught, but that depends on the carrier/manufacturer.  And if you're running a custom ROM and your phone breaks, you will often not be able to restore the backup (depending on how it broke).  If you want to keep your warranty, don't do anything that is against its terms.