Student or Learner
which of the two prepositions should be used in the following sentence?
people have difference of/in opinion.
you just need an adjective to modify the noun "Opinion"
in your example, since People's opinions differ then you need the adjetive form of the verb "differ", meaning "Different"
So the correct (or at least most natural IMHO) expresion is:
people have different opinions
Also remember that you are talking about Different people's opinions so You need the S at the end of the word opinion because, each person has a different opinion, which mean that there are more than just one general (shared) opinion, SO THERE ARE MANY OPINIONS, (plural)