As far as the action goes, they pretty much mean the same thing.
Personally, whenever I hear someone say that they "Dozed off," I feel like they sort of "descended" into a sleep. Have you ever been in class or at work and felt yourself blinking slowly and fighting to keep your eyes open because you were so tired, until you finally fell into a very light sleeping state? That's how I imagine the phrase "Doze off"
Whenever I hear someone say they "fell asleep in class," I often imagine someone who is tired and puts their head on the desk and falls asleep willingly. That's not always the case, of course, but that's what I associate it with.
You can use the two interchangeably and they are VERY similar. What I wrote above is how I associate the terms as a native English speaker, and I obviously cannot speak for any other English speaker.