Yes, you can charge an EV from a generator, there are already devices for that on some service trucks.
There is another option (although not recommended by any manufacturer): If the EV still goes into drive mode, just tow it for a short distance and use regenerative breaking. You should be able to gain 2-5 times the towed distance as range.
Edit: this technique is not recommended, although it seems to work. It’s very important that the car still turns on and you can select D. Otherwise the car may get severely damaged. If the car is off, it should not be towed more than about 5 time its length. When you tow it, there is a lot of electricity generated in the engines, even if it’s off. (There are exceptions from this rules though).