I see a distinction between "in an exam" and "on an exam" in that the former refers to the event and the latter to the paper. So you might talk about being nervous or managing your time in an exam, but you would speak of a question on the exam. "Cheating" would make sense in either context. (There is also a phrasal verb "cheat on" which is usually used with a person as its object to mean to be sexually unfaithful to them, but that doesn't really apply to exams.)