I assume you mean the solar powered lights?
ni-mh would work in them but not to full capacity, but you'd be better off replacing the nicd with more nicd's
ni-mh would not get fully charged by a solar charger as it is a trickle charger and ni-mh are not designed to be trickle charged whereas ni-cd batteries are.
(also although hardly relevant at this time of year in the summer those garden lights can get quite warm and ni-mh batteries don't like being too warm (they won't do anything dangerous, just hold less charge))