Market protectionism is sufficient to provide pushback on Chinese product dumping in Europe in the medium term. However, as the global order deteriorates and countries have to pick sides most of the EU is unlikely to choose to align with a Russian ally.
Opening a factory is a different matter. If the factory contains significant capital (ie isn’t just glorified assembly) then much of the manufacturing capacity is domestic as is the labor which is a method of avoiding tariffs that host countries tend to favor. The calculus is different at that point and could only affect the imported parts or raw materials if applicable. In a pinch such manufacturing can be nationalized and repurposed.
They will be “persuaded” with sanctions. Europe is not really a sovereign entity.
EU defense and government contractors might not have a lot of agency, but plenty of other businesses do depending on the country.
The demand reduction is also a problem for Tesla.
But one thing Chinese EV companies have is existing products in the lowest market segments. Tesla is giving up on a car cheaper than the 3 and I don't think that's a particularly unique Musk decision. American public companies are allergic to low margin products.