*Disclaimer - I am not a doctor, and I am not qualified to treat, prevent, or cure any medical condition, if you believe you may be experiencing a form of medical emergency, please disregard everything I say, and immediately seek out qualified medical attention*
I've hurt myself a lot in the gym, and my clients have hurt themselves a lot in the gym too. The vast majority of these 'injuries' are normal byproducts of using your body in a physical world, and if you didn't get these aches and pains from squatting or deadlifting, you would get them from mowing the lawn or helping your buddy move his new couch.
There are a very, very, small number of catastrophic physical injuries that occur during strength training, but it's never happened to me, or to any of my clients, and I believe these terrible events, like broken bones, or completely severed muscle bellies, can only happen due to unwise decisions in the gym, going far off program, lifting way too much weight, and paying very little attention to advice I give about technique and it's application to your lifting. Honestly, I don't worry about these at all.
BUT, strains, pulling muscles, pops, sometimes in the groin, hamstring, low back, or elbow, WILL happen. They happen to everybody and they will happen to you, too. If they don't happen in the gym, they will happen somewhere else. The important question you need to ask is: what do you do about it when it happens?
The very first step when you feel something happen is to not panic. The biggest mistake I see lifters make, including myself, is allow the small injury to disrupt your training and prevent you from exercising.
The most common tweak that occurs is in the low back, due to the nature of bipedal locomotion, and I've seen dozens of lifters take that as a sign they need to chill out, stay home, and return when their back feels better. The problem(s) with this are a) your back may take weeks to feel all the way better if you stop moving it, which sucks and b) that amount of time is now being spent allowing you to weaken instead of continuing to grow stronger.
The second step is to evaluate the pain during movement. What you need to understand is if the pain is dull or sharp, and if the pain worsens with movement or with being sedentary, or the pain worsens with resistance.
It's possible the pain will feel sharp, indicating damage being done to the body, right after the injury occurs. No problem. Most of the time, it takes a maximum of about 48 hours of good sleep and food and rest for the pain to become a dull ache, indicating healing has begun.
Once the pain is dull, you should move it, start with 0 resistance and just see if the pain worsens after a couple of empty bar sets. If the pain is present but not worsening, add weight. What will probably happen is that you will notice that the pain is exactly the same regardless of how much weight you have in the bar, as long as you focus on performing the lifts with excellent technique. This is an indication that you can start rehabilitating.
Using all the recommended protective equipment, and practicing excellent technique, if you perform the lift that injured you with as much weight as you can perform without causing the pain to get worse, you will typically cut the amount of time that you suffer with a strain or tweak down from several weeks to a few days.
The first time I tweaked my low back, it took me six weeks of frustration and rest to pull off the floor again. The 25th time I tweaked my low back, it took me 36 hours of extra protein and a few light deadlift sets before I was pain free and pulling max loads again.
Motion is lotion.