Is it possible to mount a disk brake hub to a rim-brake rim?
There's no problem mounting a disc-compatible hub to rim-brake compatible rim. Just make sure they've got the same number of spokes and you're good to go.

You're absolutely right about the opposite though, disc brake rims generally do not have a braking surface on them, the rim profile is round there, so it wouldn't work. And if you did try to brake on it, it a) wouldn't work well and b) would probably cause excessive rim wear.

What you could do, if you want to be flexible and switch back and forth is to get a dual-duty rim that supports both, such as the WTB Dual Duty FR rims (probably a bit beefy, but you get the idea).