Medicare parts A and B will cover the cost of ankle replacement surgery, but it’s important for your doctor to indicate that the surgery is medically necessary.