Those other companies can qualify for the same subsidies. Sometimes it’s a first mover advantage (subsidies change over time), and sometimes it’s not. But AFAIK, Tesla and SpaceX don’t get any subsidies that other companies couldn’t qualify for. Maybe there are some that foreign companies can’t get, but that’s not unique to the US (see AirBus vs Boeing).
That said, I’m generally against subsidies. For example, I think the EV subsidies have essentially just changed into additional profit margin. Look at what happened to Tesla Model Y prices when subsidies changed, it basically dropped by the amount of the subsidy reduction. If we removed EV rebates today, I think car companies would drop prices by about that much, which means those rebates are essentially pure profit. I don’t think that’s the case for SpaceX though, but I don’t know enough about that industry to know for sure.