ULEZ is based on Euro emissions category, and AFAIK no cars had their category changed retrospectively.
In any case the majority of dieselgate cars were sold during the Euro 5 era, and all diesel cars from that era pay the ULEZ charge anyway. Only Euro 6 are exempt.
The ULEZ came in after so it wasn't reassessed.
Those diesel cars were sold as "clean" though and now quite recent ones are subject to ulez penalties unlike much older petrol cars