The megaflip lets you greatly extend the length of your backflip or sidehop by first rolling into a bomb.
The megaflip is similar to the recoil flip. In fact, they get exactly the same distance. However, the megaflip can be used while Hovering. This allows you to hover much farther than with regular backflips.
Unlike in Ocarina of Time, the megaflip in Majora's Mask requires near frame-perfect timing. In real time runs, when there is an option, the Recoil Flip is probably better. The megasidehop is also an option, and is a bit easier than the Megaflip, but it gains no height, but the same distance.
By holding left or right during a megaflip you can greatly influence the direction you go, which is useful for Fairy Fountain Wrong Warp or the Great Bay Temple boss key skip. Hitting back stops all of your momentum and is also what makes the megaflip much harder than the megasidehop, because you have to let go of back within a few frames of backflipping.
If you fail a megaflip in such a way that the explosion hits you while the stick is in ESS position on its way back to the neutral position, the game will crash. To avoid this, it is recommended to flick the control stick forward quickly instead of letting it return to neutral. Doing so causes the ESS position to be passed right through faster than the game keeps track of inputs, essentially eliminating all chance of crashing your game.
Like almost every trick in the game, megaflips can be pause buffered. This video shows the frames you're looking for; in all scenarios, shield drop and roll (buffer R and A) on the shown frame, then buffer either a sidehop or a backflip (buffer A while holding left/right/down) on the given frame. Make sure you only advance one frame after that, though, so you can let go.