Yes and no. So basically Golf carts require a stand-alone charger. If we have the ability to recharge batteries based off of the motor used for propulsion, why are hybrid cars even a thing? Why isn’t this already being implemented? Maybe it is and I don’t know.
Motor: Electricity
Engine: Combustion
Every hybrid car sold today uses the exact thing you are talking about. the motors are capable of regeneration by converting the vehicles kinetic energy into usable potential energy + heat (batteries). Every single hybrid and every electric car I know of uses this system. I.E the motor is also used as a generator.
Now why can't we use this for everything? Well the laws of physics still exist. ICE will exist until battery tech improves ten fold. The reason is simple: When you are pumping gasoline you are literally transferring thousands of volts of energy. So far we have no way on earth to realistically transfer electricity that quickly.