Unless the law varies hugely where you live compared to the rest of the Western countries, that's just simply 100000% not true. You can do almost any modification to your car and it doesn't void the warranty, unless the manufacturer can show that the fault occured due to the modification being fitted(so no, a manufacturer cannot refuse engine repair because you used a 3rd party windscreen or fitted custom rims on the car, unless they can prove that either of those caused the engine damage).
In much of the West (including the US, even though it has generally weak consumer protections), there is a statutory restriction with regard to when the manufacturer can and can not void a warranty.
Unless it can be proven by the warrantor that the 3rd party labor or parts caused the fault, the use of 3rd party labor or parts does not void the warranty.