In a car race, if 3 cars started the race and are approaching the first corner (Left corner) and almost the 3 cars are arriving the corner equal in distance and almost equal speed, is there any rule about who should keep the cornerning line? The black car ended hitting the red.
Without question, if you are at least half-way alongside a car, the car on the inside has "the right" to claim the entry to the corner. In the example you gave, it sounds like the black car actively turned into the red car.
As an example, let's take the corner out of the equation for a moment; if one car actively turns into another car on a straight, then the car that turned would be deemed as the one that caused the accident and is therefore at fault.
The same principle applies mid corner - actively turning into another car causes an accident and is therefore bad.
Conversely, if red had failed to turn in (e.g. missing a braking point) this may have prevented black from turning in but black could still avoid that accident (showing down and/or tucking in behind red). I think the relevant point is that by turning in on red, black causes an accident that red could not avoid and should therefore be held accountable.
It becomes slightly more complicated on the exit of the corner. After the apex, cars will naturally drift to the outside of the turn therefore reducing available space. If two cars are literally neck-and-neck, there is a mutual responsibility to respect "racing room". MSA Blue Book regulation Q14.4.1 states that drivers
...should leave at least one cars width between his own car and the edge of the track...(deliberately) crowding a car beyond the edge of the track (is) strictly prohibited
Consequently yellow would be expected to give enough room for red to exit alongside, and red to give enough room for black to exit alongside (again, assuming they were ALL exactly level throughout the corner). However, if either car is less than halfway alongside then whether they are on the inside or the outside, the onus is the car behind to avoid the accident.
In this case, since we don't know where the collision occurred and the relative position of each car immediately prior and at the point of collision, one cannot say with certainty who was at fault, though it looks a lot like black turned in on red from the lines you've shown. To answer your specific question, notwithstanding the missing information, it is highly likely that the "right" to the corner falls to yellow, then red then black.
Despite embellishing my initial response and expanding on the difference between corner entry and exit, this answer could still be improved.
My answer is specific to Formula 1 but I suspect it's the same for other formulae.
In the example given, none of the 3 cars can keep the racing line as it would likely lead to an accident. In Formula 1 you are penalised for "causing an avoidable accident".
All 3 cars are alongside each other heading into the first turn, they should all therefore ensure they allow each other "racing room". The fact that one car is currently on the racing line is not so relevant as the race has just started.
Generally speaking the car on the racing line has "right of way" and can take the racing line but if another car is alongside the driver on the racing line cannot reasonably assume the other driver will make way, he cannot simply disappear into thin air so both drivers would need to give racing room.
The exit of the corner is a little different as the driver on the racing line can stick to this and the driver on the outside of him would have to give way, plenty of examples of this in F1, watch Hamilton vs Rosberg.
You'll need to search "Hamilton vs Rosberg Bahrain 2014" on Youtube or similar as the FIA remove the videos quite often due to copyright issues/Bernie not having enough money.
In summary the car that is ahead can claim the racing line but if alongside each other they need to give "racing room" to their competitors.
It's not easy to determine what constitutes being "alongside" the other car though which is why there are stewards to judge incidents and penalise drivers accordingly.