Using a third-party cable or charger with a device generally doesn’t void the device’s own warranty under consumer protection law in most regions — but damage clearly traceable to a faulty accessory can be excluded from a repair claim.
Hold onto proof of purchase for any charger over $20-30 — most manufacturer warranties (typically 1-2 years) require it for a replacement claim.