Let me put some numbers to this:
a = ((v1*v1) - (v0*v0)) / 2d
Say you are travelling at 20 MPH v0 = 9 m/s
d = 2 mm of foam (say for a cycle helmet) a = 20250 or 2025G (most likely fatal even though the G force is for a very short duration)
d = 50 mm of foam (motorcycle helmet) a = 810 or 81G (most likely survivable)
I hope this illustrates that it is mainly about the value of (d) and a bicycle helmet gives you very little.
As TREF says above, these bike helmet need a re-think. I believe that the way forward is a lightweight aluminium honeycomb outer shell which distorts on impact (giving a greater value of (d). The current polystyrene ones are a con (very little (d)).