Manufacturers are forced to make available repair procedures and test equipment to the auto industry, and specifications to parts manufacturers so they can make matching quality alternative parts. At some point, if not already, Tesla will fall foul of these legalisations, or the legalisations will get updated to remove any loopholes that they currently may be making use of. Warranties cannot be voided just because their dealers haven't done certain work or third party parts have been used - only if the work or parts have directly contributed to the fault being looked at under warranty.
I'm not sure the manufacturers are forced to make their OEM parts available to sales in the trade - almost all manufacturers do though, otherwise they would lose more revenue to the alternative parts industry. Market forces will come to play here, if Tesla don't make their parts available then the value of used vehicle will fall too far as it would be too expensive to keep them running - that would have a knock on affect of valuations on younger vehicles too so Telsa will be forced to react. At the moment they have a unique offering and people are prepared to pay over the normal industry value for their vehicles, in a year or two there will be a lot of choice in the EV market.