It's true that there is a contribution from air compression in constrained foam structure, in addition to elastic deflection and buckling of cell walls. You can go as deep as you wish into this
Deformation mechanisms and energy absorption of polystyrene foams for protective helmets for example.
Any physical process involves exchanging energy - don't anyone get too worked up by "absorbs" vs "dissipate". Generally speaking with classical mechanics, you usually have a choice of approaches based on conservation of momentum or conservation of energy, without mixing them. It's not
invalid to use both, but generally unnecessary. I focused on a momentum approach and didn't mean to imply any particular energy equations.
The intended takeaway there is that the protective mechanism is reducing peak impact by extending the time.