If you’ve had an ankle injury, it’s best to see a healthcare professional and get your ankle treated.
If it’s a sprain, you will probably need to rest and stay off your feet for a while, and possibly you will have the option to use crutches to keep the weight off the injured leg.
If the cause of your ankle pain is some sort of inflammation in the feet, such as plantar fasciitis or tendonitis, the result will likely be extra stress on various muscles and tendons, including those in the ankles, because the inflammation will affect the gait. In such cases, wearing good supportive shoes may allow you to walk with ankle pain and could even alleviate or treat it.
Still, before you decide whether or not to walk with ankle pain, it's best to consult with your healthcare provider.
Finally, it is worth noting that wearing the right shoes can also help you avoid ankle pain in the first place.