Yes, A generator can easily charge solar batteries as most of the modern off-grid solar may not be able to meet the entire need of the property from solar energy alone and is often paired with a generator. Gas generators are used as a backup source of charging. They can also be used if the inverter equipment fails and bypassing is required for the system.