Yes, absolutely, and it can make plenty of sense sometimes. Hubs failing early is one case. It has also become more frequent, although maybe not common, for people to want to swap carbon rims around, especially on disc brake wheels, because they have so much invested in the rim, and they can go a long time. I've rebuilt a handful of carbon rims in recent years for people playing with different hubs who wanted to keep their big dollar rims.
When you unlace the old rim, you want to do so in a fairly gentle, gradual way, especially at first when the spoke tension is still high. It's not good for rims of any material to be bent around unnecessarily, which is what happens if all the tension gets released at once on a spoke while the others are still tensioned. In other words, cutting the hub out like one does to re-lace a hub is not what you want to do here. What I do is go around doing detensioning layers of a half turn per spoke until I have quite low tension, then go to full turns. As soon as the spokes are sloppy loose, there's no tension and you can cut them or use a nipple driver in reverse from there.
Once you have your bare rim, it's a good idea if possible to check what kind of shape it's in without being acted upon by spoke tension. I always do this by taking a good quality new machined sidewall rim of the same size, laying it on the bench or ground, and laying the rim to be reused on top of that. You're essentially making a surface table out of the new rim, and it works well. Any lateral kinks or distortions will reveal themselves easily. Major radial dips or rises can be felt for this way too, but it's more subtle. If there are any radial distortions, the old rim probably isn't worth messing with. If you find lateral waviness inside of 2mm total gap or so it's probably fine; it will create some amount of tension imbalance, but only on the order of a couple quarter turn adjustments.
As far as fatigue, if you're gentle with taking the old wheel apart, there's not much difference between reusing the rim and continuing to ride the old wheel.