Here in the UK, that happened to me on a roundabout. Elderly driver in front pulled out and then, for no visible reason, slammed on the brakes. I ran into the back of her.
It was deemed to be be 100% my fault. Here, if you run into the back of the car in front, it is always your fault. No exceptions.
It makes sense: you should always leave enough room to stop, so I couldn't really complain. But, if everybody did that on that particular busy roundabout, it would result in gridlock.