Is soldering wires directly on a NiMh battery safe?
It's probably safe enough from your point of view, but not from the battery's.  You really shouldn't solder to batteries unless they explicitly have solder tabs for that purpose.  Most batteries, and NiMH are no exception, are damaged by soldering temperatures.

The way to make a permanent connection to a battery that doesn't have solder tabs is to use spot welding.  This presses the battery terminal and the contact together, then zaps them by discharging a capacitor thru this connection.  That heats the two parts enough for a little metal to melt and bond.  However, the zap is very short and localized, so the total energy is low and high temperatures diffuse well before they get to sensitive parts of the battery.

Note that no solder is evident in the picture you show.  That is because the tabs were spot welded, not soldered.