Students often get confused about these two combinations. Well, since preference is comparative in nature, the correct construction is PREFERENCE FOR.
What do I mean by comparative in nature?
Preference means that you like something or someone MORE than others. There is an element of comparison between two sets of things/ people.
Now, things get more clear if you understand the difference between FOR and IN.
FOR = intended to be given (preference is given)
IN = Inside something (preference is not inside)
So, “preference for” is the right construction while “preference in” is incorrect.