That’s what BMW did with their i3 REX models: a scooter engine and a tiny tank, hooked up to the electrical system. Turns out though that the extra weight impacted the performance without adding much in the way of range to the point that it wasn’t really worth it.
A 2000W inverter generator could give a Chevy Bolt an extra 14 miles of range after 3 hours of charging. A 240V generator could shorten that time or lengthen the range but would also be larger and take up more room in the car. Carrying gasoline in the back of your car all the time in case you run out of battery is somewhat dangerous. The generator means less cargo space as well. For a long trip to the middle of nowhere it may make sense to carry a generator and some gas. For a trip into town it may not.