CAN is quite similar to I2C, so my answer would be based on I2C.
In I2C, Arbitration is supported as well.
If 2 Masters try to send a sequence at the same time, the one with the higher priority, call it Master A, would take over the bus.
At this case, Master B, would need to wait for the Bus to become Idle again, and re-send its sequence, hoping that no higher priority Master would try to send data at the same time.
You need to repeat the latter, until Master B wins the arbitration.