Is it safe to diet while sick?

With precaution. Depending on your illness, monitoring what you eat should not be a problem. Of course, if you are eating too few calories you might consider increasing your caloric intake to help your body heal, specifically your protein intake. If you are suffering from a chronic condition, you should seek care from your physician before continuing on a restricted diet.