It would work, but there isn't much reason to do it. If you do this without batteries, you are giving up most of the potential advantages.
If you simply have an internal combustion engine (petrol or diesel, hereafter an ICE) driving a generator driving electric motor(s), then the engine must rev up and down according to the load from the motors at that instant, and thus has to behave in a similar fashion to an ICE that is driving wheels mechanically, except that some of its output is being lost in further conversion inefficiencies, and you are driving the weight of the electric motors around. Some heavy systems - e.g. trains, large industrial trucks (as noted in another answer), and ships, do do this, but as I understand it that's because it's a better transmission arrangement for these purposes for reasons that probably do not apply to cars.
If you add batteries in the middle - so that you have an ICE charging batteries that are used to drive the car - then you have what is called a "series hybrid" system. There are two significant advantages to this approach:
Regenerative braking can be used. When the driver wants to slow down, instead of using only mechanical friction - which converts the car's kinetic energy to heat and wears away the brake pads - the motors can work as generators and reclaim some of the kinetic energy back into electrical energy in the battery. This can provide a big improvement in fuel efficiency for city driving, where lots of starting and stopping is required, as the car's energy is not being thrown away every time it stops.
When the ICE is running, it can be run at its most efficient rpm. When the ICE is not required (because there is sufficient energy in the batteries), it can be stopped. There is no need for the ICE to idle, or to otherwise run outside its most efficient range. Additionally, because the battery smooths out the peaks of demand (e.g. accelerating up a hill), the ICE must only provide for the average power required, not the peak. This means that a less powerful engine can be used to provide the same vehicle performance. Both of these things reduce the engine's fuel consumption, whether in cities or on the open road.
As a further, optional, elaboration, if the battery capacity is high enough and a charging socket is added, this arrangement can be used as a "series plugin-hybrid electric vehicle". For short journeys the battery is charged from a mains supply and the car operates as an all-electric vehicle, and for longer journeys the ICE is used.
Incidentally, according to Wikipedia this is the arrangement used by the Chevy Volt. Another vehicle with a similar system is an optional varient of the BMW i3, which is by default a pure-electric car that can optionally be fitted with a "range-extender" generator. In this case the ICE is not sufficiently powerful to drive the car indefinitely, but adds substantially to the range that it has before charging.