The creme egg won't melt because the batter is thick enough, and you fry it quickly at high heat so the outside cooks before the inside heats up significantly.

This is also the idea behind deep fried ice cream.