Depends. If the guy in front deliberately brake tested the guy behind, then this would be, at worst, contributory negligence. At least, that's what I'd argue.
Guy in front says "There was a cat/dog/small child on the footpath that looked like it was about to bolt onto the road so I hit the brakes".
It is always the fault of the tailgater, no matter what.