I've taken all of them (well actually ecstasy instead of MDMA) but I was surprised a few months ago how cannabis and nutmeg were similar. I know many bluelighters have a thing against nutmeg (rightfully so) but apart from the nausea, I can honestly say the "time distortion" is the exact same. Cannabis feels much 'cleaner' than nutmeg in terms of the experience itself but still very similar.
Same with ecstasy the "deja vu" like feeling.
Do they share anything in pharmacology? I know they can be classified as empathogens.
Pharmacologically, no, they do not seem to be similar. Our current state of knowledge suggests that nutmeg acts an anticholinergic, i.e. a deliriant, similar to high doses of diphenhydramine. Alexander Shulgin once made the hypothesis that the myristicin in nutmeg might be converted to the psychedelic serotonin releasing agent, MMDA (not to be confused with MDMA) in the human body, but that was mostly just him spitballing, and there is zero evidence that this actually happens.
The thing is that nowadays, we can usually atleast tell what receptor a drug initially binds to, but it becomes much harder to analyze its downstream effects - one receptor being activated can result in a cascade of signals that affects the release of other neurotransmitters, which leads to other parts of the central and peripheral nervous system becoming more active / suppressed,
something something glutamate, etc. Not only that, but the same receptor being activated by different compounds can apparently result in different downstream effects (ex.: the reason NBOMe's are deadly while LSD isn't might be that NBOMe's activate the 5ht2a receptor in a way that apparently causes downstream signalling that promotes blood clotting, which can be deadly when the same drug also causes your veins to constrict and blood pressure to rise).
Anyway, I find it a bit of a stretch to classify cannabis and nutmeg as "empathogens". I mean, pretty much any psychoactive drug could make you feel more emotionally open towards other people, simply by virtue of making you feel more at ease/confident/delirious-with-no-concept-of-boundaries, including ethanol, crack cocaine or PCP, but realistically, I would restrict this term to serotonin releasing agents, and maybe mild psychedelics that directly affect certain serotonin receptors.