Captain America said "if you get killed, walk it off!" How to understand "walk it off"?

Solution 1:

"Walk it off" is a flippant response for when someone is hurt or injured. It generally means that they should continue as if nothing had happened (that is, they should continue walking), and that they'll be back in good health after a while. An example might be if you took a bad step and hurt your ankle slightly; it may well be better to continue walking until the pain subsides instead of stopping.

In the Captain America example he is joking that even dying should not stop you from winning; you should pretend that nothing happened and keep fighting.

Solution 2:

When one is injured, for example in an athletic competition, the advice might be to get up and walk around in pain until the pain subsides and one is again able to participate. This is opposed to one's probable inclination to lie on the ground until one feels able to continue. "Walking it off" is seen as a tougher and perhaps quicker way of dealing with the injury.

Being killed, here, is treated just as any other injury, as if it were possible to recover from death.