When you’re working out (especially if you’re not quite used to it) then it’s a definite possibility that you may end up injuring yourself. Heck, it’s easy to get hurt even if you are used to working out or even for a completely unrelated reason. You could end up twisting an ankle going up the stairs or straining your back lifting a heavy box. What’s important is how you react to your fitness when you have an injury that gets in the way.
The short answer for whether or not you exercise with an injury is simply don’t do it. Attempting to exercise when you have an injured body part doesn’t just irritate you when that body part is sore, it risks doing more and potentially even permanent damage depending on the severity of the injury and the strain your exercise puts on that part of your body. When you’re injured the most important thing that you can do is rest yourself and put your leg up, keep your arm on ice, or stay in bed and let your back heal or whichever course of treatment works out best for you. Even if you’re not exercising it’s still important to watch your nutrition and log your values so you have something to go off of when you recover.
The importance of rest and recovery being said, you can still exercise your body in some ways even if you have an injury provided your exercise won’t affect that body parts path to recovery. If, say, you have a broken thumb then it’s entirely possible to still go out for a jog and get in a little bit of cardio when you have the chance. If you’ve twisted your ankle then maybe think about lifting some dumbbells or using resistance bands provided it doesn’t strain your leg. If you want to exercise while injured then you need to find something that won’t stress or strain your injury in any way. If you’re worried it might bother what you hurt, just don’t do it.
The real risk of exercising through an injury comes from the potential for extended suffering and even permanent injury. It’s not just about toughing it out and working through the pain, if you continue to stress an injury then there’s a very real risk of that injury becoming worse. The last thing you want is to sprain your wrist, go to lift some weights, and end up breaking it instead of just the sprain because you couldn’t lift them properly or safely. At the end of the day, if you’re injured then it’s time to look at whether or not that injury was caused by something you did while exercising and to get the rest your body needs so you can get back to your weight loss once you’ve recovered.