Based on this article, it sounds like the NiMH batteries could be safely used with a charging system that is designed to slowly charge NiCad batteries.
However, the lifetime of a NiMH battery charged that way may be poor compared with a NiCd one. The same question was asked in a battery forum, and one of the responses was:
The cheaper priced NiCd is a good option.
I think the problem with eneloops in solar garden lights is not
overcharging but over-discharging. The capacity is too high for them
ever to reach a full charge in a day of sunlight, but at night the
lights will run them right down to empty and beyond. NiCd can take
deep discharge cycles much better than NiMH can.
However, obviously not everybody is in agreement with this. This other site seems to say it's a great idea to replace NiCd's with NiMH batteries instead. Maybe it depends on the brand?
I don't know who's correct about which is better, however I do know that NiMH batteries quickly deteriorate if left fully discharged. If you're going to put a solar light (containing an NiMH battery) into storage, allow it to charge up at least partially first.
If you ensure NiCd batteries are correctly disposed of, the potential environmental impact is heavily reduced.