I don't know about the BYD, but the Tesla Y has a 5 star rating from ANCAP, Euro NCAP, and the NHTSA. I'm far from a Tesla fanboy. I'm just genuinely curious why you think either is unsafe.
I don't trust Tesla manufacturing standards broadly. Namely because they frequently look to cut corners and have been to court over it a number of times. Their autopilot was defective, they knew it was defective but kept selling it. That kind of thing in addition to Musk cementing his identity pubically as an intellectually dishonest person erodes confidence.
A more recent example is that the cyber truck's accelerator gets stuck at full throttle because of the cheap materials they use, or there are instances where the touch screen bricks the whole car. Imagine spending 100k on a car and having it become a paperweight because of a software issue.
And then on the other side the BYD stuff is more than likely just stolen Tesla tech. I don't think we'd ever get real safety statistics about companies in China.