Yes, it depends on the car. I only know from personal experience with the W205.
NOx sensors after Gen3/4/5 are "patched" and require MB Diesel Emissions Update, which uses a different algorithm.
Gen1/2 are not compatible with Gen3+ software versions. These older sensors manipulated values in the system.
It is always best to replace the NOx with the same version of the control unit that was installed on the car to avoid having to change the software, although Gen3+ sensors with updated software are more reliable.
NOx sensors can be car specific, although I put a W177 NOx in a W205 as a test and it worked for 6 months before dying. It worked because the car had Gen2 and a patch.