I'm a welder and fabricator by trade so should be able to impart some truth.
The bottom line: Yes, it can
Fisrt struggle will be finding someone skilled enough to do a decent repair for you. A lot of welders with a 'have a go' attitude will take your money and attempt a repair without having the full knowledge of just how thin an ally frame can be and how prone to distortion and blowing through they are. Those who do have the skills are often working in an environment that is just not geared up for doing one-off jobs like this. The sort of level of skill needed is often found in workshops dealing with military and high level industrial contracts that are sensitive and they just wont let you in the door.
This leads me onto the depth of your pockets. they will be the main issue as to whether you want
All damaged frames can be repaired, no matter what anyone says, even tubes that look like shattered eggshells can be sectioned and new material welded in at the worst case, and adding gussets is often preferable in my opinion ( if it failed once, it was for a reason!) but repairs like that take time, and time is money. Welding is the easy part of the process, the time is in preparation. paint removal, cleaning the tubes, grinding and drilling out cracks, fabrication of repair sections/gussets etc etc etc. it soon adds up.
The last frame i repaired took a little over 2 hours to fix, my work charge £36 an hour, most engineering shops charge well over 40 and in the south east it can be double that. The bike in question cost the guy over £1500 new and was only just out of warranty, he considered it a worthwhile fix.
Then the most important part of any fix is heat treating. You heard right about welding annealing the material. when you see 6061 T6 on a label, the T6 part is the heat treatment coding. T6 is basically as high as you can get without losing fatigue resistance and either side of a weld the material will be softened. A lot.
To put this right, the whole frame will need to be put through a series of heating and cooling cycles in a furnace (all the paint will have to go before this is done- an extra expense) and its not a DIY job, it will have to go to a specialist heat treaters. Once this is done, full or sometimes even greater strength is achieved, then it can be repainted.
A considerable expense as you can imagine.
so not always worth it.
Most people opt for a crack to be ground out, the ends drilled, welded, and then where possible, a gusset or doubler added, then a localised repaint. 90% of the time this will suffice and add a decade or so to an alloy frame for less than the cost of a new replacement.
I cannot however guarantee that after all this, a riders 100% confidence will be restored, there seems to be a LOT of paranoia in the MTB world. Failiures happen. The balance between ultimate light weight and boulder crashing strength will always be a compromise and there will always be riders who push the limits and those who don't!
The choice is ultimately yours.
Sorry if i've bored you, Just setting the record straight, I read a lot of misinformation on this subject on the interwebz