These two words can mainly be used for prepositions of place.
On usually means that something or someone is 'on' a surface. The dog is lying on the floor.
In usually means that something or somebody is in a enclosed area . The dog is in a room
However, there are many exemptions to the above.
Hope it helps.