I put on my raincoat yesterday because it could have rained.
Can we tell form this sentence whether it rained yesterday or not? No. It probably didn't (There are various possible contexts)
The main problem is that it's an unlikely sentence. We'd usually say,
"I put on my raincoat yesterday because it looked like rain[ing]."
"I put on my raincoat yesterday because I thought it could rain."
"I put on my raincoat yesterday because I thought it might rain."
"I put on my raincoat yesterday because I thought it would rain."
We still can't tell from this whether it did rain.
I thought that "could have" was counterfactual. Not necessarily.
A: Where's Emma?
B: I don't know.It's five o'clock, so she could have gone home. = It is possible that she went/has gone home.
a-He was driving very carefully. The roads were wet and he could have had an accident.
Can one say for sure that he did not have an accident?
Once again, this is not very natural. If we are reporting why he was driving very carefully, "... he could have an accident" is more likely, I think. In the following sentence, we do not know whether 'could have' reports a counterfactual situation or not:
A: Emma's late, isn't she?
B: Yes. I am a little concerned. Driving conditions have been terrible today - she could have had an accident.
In the next one, 'could have' reports a counter-factual situation:
I don't know why she decided not to buy the car. I offered to lend her the money, so she could have bought it.
Note that it is the context that tells us whether whether the situation is counterfactual or merely unknown.
b-They didn't know where they were going. They could have arrived at the wrong destination.
Can one say for sure that they did not arrive at the wrong destination?
Not without more context.