The idea of repairing crashed frames with real damage to them is kind of an urban legend for most people. It can be done on all materials to some extent (though it never seems to make much sense on Aluminum). But, if your bike isn't super high end, it will NOT make sense financially.
Minor bends without buckling in steel can be repaired easily, but major damage requires expensive repairs.
Aluminum often requires heat treating for welds, and is trickier to repair in general.
Carbon repairs are risky for folks who don't specialize, and there's only one or two places that really focus on that.
Any of these options will likely cost more than a replacement frame unless your frame is SUPER sweet. Like, a frame on a 5k total package bike sweet.
All frame materials can make a bike that will stand up to all normal riding and abuse for ages. If there's a catastrophic crash, any frame can be destroyed. Some are slightly more resistant... but there's a ton of variation frame to frame as well. There are carbon frames that are stronger than aluminum ones, and vice versa.
There are more instances of "better safe than sorry" canning of carbon frames, because damage can be harder to evaluate... but realistically, if they were actually a lot more prone to failure than other kinds, they'd be rarer due to liability.
Ride some bikes, find one you love to ride. Buy that bike.
SOURCE: Worked in bikes for 6 years, seen a lot of frames come and go. That covers the "what will they survive" angle. As far as the repairs angle, I just lurk and watch outcomes on the "how do I fix this?" threads. There are not a lot of great outcomes.