What you're describing is yet another example of ellipsis, in this case, where common prepositions are left out of sentences when they add no significant information. Either way is correct:
I would prefer to die than (to) kill someone.
She said she would prefer to go shopping than (to) see a movie.
I'd much prefer to stay home in bed than (to) go to work today.
If comparing two activities, then the most common construction is to make them both the same form. It doesn't really matter whether you pick the infinitive or the gerund:
I prefer skiing rather than surfing.
I prefer to ski rather than to surf.
However there are various other ways you can structure this kind of statement, that can be different depending on if you use the infinitive or the gerund:
I prefer skiing to surfing (and not "I prefer to ski to to surf")
I prefer to ski, not to surf (or "I prefer skiing not surfing)
Note: Your first example is somewhat unusual English. "Prefer" usually refers to things you would like to do, not things you would prefer to avoid. In this case "would rather" is more natural:
I would rather die than have to kill someone
She said she would rather make out with an orangutan than go on another date with him.