Hi, welcome to the forum, in simple terms, an allergy is a hyperactive response of the immune system to certain substances which are "foreign" to our bodies. These substances are called "allergens", and they can range from food and pollen to dust and drugs.
Viral infections are the most common cause of illness in children. Your child would be allergic to the some drugs, but it's most unlikely a virus. Or if he is having hives, rash, fever etc symptoms your child may be infected by virus.
The most common viruses in children are the influenza virus, respiratory syncytial virus (RSV), rhinovirus and adenovirus, hepatitis viruses, cytomegalovirus etc
You need to maintain proper hygiene of him/her. Also you can give him healthy food like milk, fruits, vegetables, regular exercise to increase immunity. Allergy problems are less seen in children’s who are breast fed. Advances in medicine have lead to the development of several vaccines that protect against viruses which once caused disease. I suggest you to consult pediatrician and immunologist. Take care and regards.