Performing surgery on heel spur/plantar fasciitis is rarely done nowadays. If all other measures have been exhausted, sometimes the decision is taken to perform surgery on the plantar fasciitis. Surgery either implies that the actual bony spur is removed, but more often the plantar fascia is released from the heel to release tension. Sometimes, the goal is to free up the nerves, as they are under constant pressure.
To achieve all this, also the plantar fascia will be affected, possibly damaged. This means that even a successful operation will require a long revalidation (weeks to months). Next to that there is serious risk of complications, which is why the operation is only executed in rare cases.
Possible side-effects could be remaining damage to the plantar fascia, possible return of pain after a few months, etc.
So, there might be cases where nothing else works to succesfully treat heel spur / plantar fasciitis, and surgery may be worth discussing with your doctor then, but be cautious.
The aim of the surgery is to remove the actual heel spur that can be seen on x-rays in plantar fasciitis patients. The actual spur though, might not necessarily be the cause of the injury. Only if there really is a notable spur on the heel the operation may be usefull.
Another surgery sometimes applied is the steindler release. This means that the plantar fascia is released from the heel. This releases the tension from the fascia and should reduce the pain felt from your heel spur. Also this operation will take a few weeks to recover from, without guarantees for things to get better.
Another method that is sometimes applied is that the calf muscle is extended. This is sometimes done when the calf remains too short, despite stretching exercises.
Also, there are a lot of other measures that can be taken, like the other treatments on this website. Usually, surgery is only applied after alll these treatments have been undertaken and proven unsuccessfull. Finally, it needs to be understood that the operation is not 100% predictable, and side-effects can occurr.