The "memory effect" is not what it's claimed to be, but you can certainly substitute an NiMH battery for NiCd. Match the voltage. The mAH will be greater, so allow proportionately more time for a full charge.
I have done many NiMH for NiCd substitutions. Electrically, an NiMH is simply an NiCd with more capacity.