This behavior is illegal.
According to my country's Trademark Law, it is illegal to change a registered trademark without the permission of the trademark registrant. Denza X and Mercedes-Benz are two different brands with different vehicle logos, brand images, product positioning and other aspects. If the DENZA X logo is replaced with the Mercedes-Benz logo, it may mislead consumers into thinking that DENZA X is a Mercedes-Benz brand product, thus affecting market order and consumers' interests.
It is recommended that car owners not change car logos at will, but should abide by relevant laws and regulations to maintain market order and the interests of consumers.