As long as the number of holes match, sure. (i.e 36 hole hub needs 36 hole rim, etc.)
I've done it. I had some old Normandy hubs I didn't want to part with, but the tire choices in 27" had gotten lousy. So, I had them re-laced to 700c rims. Needed all new spokes, of course. And you should verify that your particular frame will not have wheel clearance and brake reach issues. A little bit of work, but totally do-able.