For your specific example, I believe either works fine and should convey your intentions. There is nothing "ungrammatical" about using "in".
However, in the broader context of the English language, there is no set rule to determining "on" vs. "in". Sometimes the differences between "on" and "in" are obvious, usually when describing how physical objects relate to one another. Sometimes, the two are interchangeable (as you can see here). And finally, sometimes choosing which one is right is based on idiomatic conventions - meaning the "rule" is "how do most people say it?". For example, most English speakers would not say "What's in the menu?". They would say "What's on the menu?".