The hard drive in my Dell Dimension is dying. Is there any way to use the System Recovery partition to program a new hard drive or to transfer to the new hard drive?
Yes, you can try cloning the whole hard drive to a replacement drive. Cloning copies exactly the contents of one drive to another. If some parts of the old drive are no longer readable, if you are lucky the recovery partition will be OK and on the new drive, you can then boot the recovery partition and re-install Windows to factory conditions if necessary. I have managed to do this successfully with a failing hard drive.
I use True Image from Acronis (not free but worth the money) to clone hard drives - you can install the software and make a recovery CD that you can boot and use to clone from an old drive to new. There are free cloning programs as well. If you know the manufacturer of the old or new drive, you can go to their website (e.g. Western Digital if one drive is made by them) and download some free tools such as a cloning program to be able to clone the old drive to the new one.
You should be able to install a second drive temporarily inside your Dell while you are cloning; once done, remove the old drive, make the new one the primary drive. If this is an older Dell with PATA (flat ribbon cable data cables) drive, you'll probably plug the new drive into one of the open connectors on the same cable the old drive is plugged into. It's probably a cable select cable with Dell, so make sure the new drive's jumper is set to "CS" (cable select). If your Dell is newer then it probably has SATA drives and you can disregard the jumper comments I've made.