Much like how life is, “it depends”. Most of the time I would not recommend training while you are injured. However, you could still train as long as it is not the affected part. If you’re hand is injured, you could train legs as long as you don’t use your hand. If you’re ankle is injured, maybe you could do a chest day.
The most important part is that you allow whatever is injured to heal, and if it starts getting uncomfortable then immediately stop; a workout today is NOT worth another few days, weeks, or months of waiting for it to heal.
Sickness is a little simpler. A quick rule of thumb is if you are feeling sick above the neck, i.e. head cold, etc. then it is ok to train if you feel you are well enough. However, if it is below (compromised breathing, etc.) then you shouldn’t train and wait until you’re better.