Yes you can apply to both prelim and categorical at the same institution, but in the above situation it's a pretty stupid idea. If they interview you they will no doubt ask why you applied to both.
If you tell them it's because you're applying to radiology and using categorical IM as a back-up, then you'll have a better chance to sleep with the queen of england than to match into their categorical IM program. And if you lie and tell them prelim is the back-up to categorical IM, and they like you, they would likely rank you for categorical only and not prelim.
The only scenario where it would work out is if they rank you low on categorical list but high on prelim, but I think that's highly unlikely. There's usually no shortage of people looking for medicine prelim years (unless the program is highly undesirable), and they're likely stronger applicants also going for advanced positions. It's unlikely someone would be less competitive for categorical IM than prelim at the same program.