There's a few variables you'd need to clue us in on…
-Crew cab or extended cab?
-Year?
-What frequencies?
-Just one antenna?
I've done installs on sun-roof'd vehicles before. It can be done, but it takes some extra work. Important part is to visualize the underside of the roof. That's kind of hard to do without dropping the headliner, and for most hobbyists, that can be a substantial task.
On some vehicle/frequency combinations, you can move the antenna pretty far back on the roof and be out of the way of the sun roof. On others, you can still sneak the NMO mount above the sun roof travel area, but you have to make sure the cable is routed out of the way.
If you are looking at VHF, VH/UHF, you probably won't have much issues. I imagine your concern is about getting enough ground plane under the antenna for it to really work well. You may have to compromise a bit. I've mounted antennas at the back edge of the cab, above the third brake light, and had good results. They can be tuned up OK, but I imagine the pattern is a bit skewed.
Either way, it really comes down to either how much work you want to do, or if you can find someone who's done an install on a similar vehicle.