I've got a friend with a really narrow front wheel, and he runs a 2.5 on it. Works fine.
The rim doesn't matter as much as whether or not your frame is large enough to take the tire. My frame won't take anything larger than 2.5 in the rear, but most XC bikes won't take larger than 2.35 .