I am interested in the immune system for my own health reasons, and read about the immune system and eating, from various books by known authors and medical web sites.
Essentially, when one has a lot of food, particularly food with a high glycemic index (a lotta sugar), the body slows down the immune system function to focus on processing all those “goodies.” The number of white cells and other immune cells drops, and doesn’t fully recover for about five hours. If you have ever had surgery, you probably have noticed that afterward you have absolutely no appetite. My theory based on the above is that the body is busy repairing; no time for food processing!
Therefore, as in most things, eating healthy food in moderation, focusing on nutrition-rich, antioxidant-rich foods that are relatively low calorie, will help keep your immune system running well to fight whatever is attacking you. I don’t know if this has an equal impact on viral infections (colds) and bacterial infections (fever could be either viral or bacterial), but keeping the immune system up can’t hurt either.
Also, drinking a lot of water helps immune cells travel around to where the bad bugs are wickedly duplicating themselves.
Of course, when one is feeling crappy, having an indulgent dessert may be very pleasant, and we all know that our mental state influences our body.