Can surgery correct ed?

No, but... Everything we do in life / medicine is just to modify something for working better, but always comes with a price. Any surgical care is considered as the last resort of care after failing to respond to drug, physical therapy, lifestyle change, injection, etc. So, ed-related surgery may be penile implant, penile straightening for peyronie's disease, just like hip/knee replacement for djd...
Yes. When a man has erectile dysfunction, there are multiple treatment options including oral medications, penile injection therapy, and a vacuum erection device. If all the agents fail and/or contraindicated for that patient, then the last resort is surgery. This is for placement of penile implant (prosthesis). There are several types of implants depending on patient preference and patient dexterity.
Depends. Cause of erectile dysfunction must first be determined. At 24, most likely anxiety. Most common algorithm for appropriate candidates starts with oral medication (called pde5 inhibitors=sildenafil=viagra) first, followed by penile injection therapy (usually mixture of phentolamine, papaverine, alprostadil= trimix). If these steps do not work, then penile prosthesis surgery is considered.
Basically not. Only when the cause is vascular after an injury, vascular repair might help. Not respondents to medical treatment may consider penile prosthesis with pros and cons. Ask to a very specialized urologist in e.D.