You can rank you categorical and prelim programs in any order you wish. Most people will rank all of their cat programs first, and then all the prelims -- but you can do anything. Rank them in the order you want them -- ignore what you think programs want.
Programs will rank you, and the match will find the best fit FOR YOU.
Example: Let's say I have a categorical and surgery program, each with 2 spots. Kinda small, I know, but let's go with the flow.
I rank you #20 on my categorical list. A long shot, to say the least.
I rank you #1 on my prelim list. Wahoo! A sure thing.
If you rank:
#1 Categorical
#2 Prelim
The match will first try to give you a categorical spot. If I go down to #20, you get it. If not, the match will try to give you a Prelim spot. Since you are ranked #1 there, you get it.
Key here is that you cannot hurt yourself by ranking programs that you think you have no chance of getting into. You cannot lose a spot by ranking it low on your list (unless you match into something higher on your list, which is a good thing!)
You can hurt yourself by ranking programs you don't want to go to, and then matching there.