Ice and NSAIDs both treat inflammation as well as reducing pain.
Inflammation is caused in part by vasodilation forcing blood and fluids into the area. Ice treats this by numbing the area, and causing vasoconstriction to limit blood flow.
NSAID is short for Non-Steroidal Anti-Inflamnatory Drug - so the name alone should indicate that yes they have pharamological agents that treat inflammation.
Inflammation is a response to injury, so preventing inflammation can be dangerous!
Inflammation happens for a number of reasons, but is most often in reponse to injury. Inflamming an area can cause tendernous making your body more cautious with that body part or can restrict movement to allow for recovery. In your example, the inflammation is most likely reducing your range of motion through your ankle as a protective measure to prevent further damage.
Rather than just treat the inflammation, treat the cause of it. This might include changing shoes, changing stride or stretching but it all depends on what the damage is. If your inflammation continues you would definately want to speak with a medical professional.