I don’t know if it was a lawful order, but I certainly would not have been willing to antagonize a police officer over that particular order.
Smokers tend to light up in times of stress. It helps keep them calm.
It is hard to think of a group of people who are subjected to more hounding and harassment from the media, the workplace, to non-smokers driving them out of jobs, bars, restaurants, and public buildings with not so much as a designated smoking area left in many cases--even the ones who thought it was reasonable to have non-smoking areas (often with separate HVAC systems to keep the smoke out around here).
Anyone who has ever had people start coughing upwind from them as they pulled the cigarette out of the pack (still not lit) and whining about the smoke is going to be a mite defensive over the few places they are still permitted to smoke, among them their vehicle.
And all this while pot is being legalized, often in jurisdictions where tobacco is treated as the cause of all evil. That places a chip on many smokers' shoulders, and in their own space (vehicle) most will damned well smoke if they please.
Sorry, but the policeman should not have even gone there, especially during a traffic stop. If he had had her come back and sit in the police vehicle, that is his turf, his rules. In her car, another matter.
A polite request would be one thing, but an order under color of law is well over the top if there is no immediate combustion hazard.