Yes, it is generally safe for a 2-year-old child to receive vaccines while taking antibiotics. As long as the child is well enough to attend the appointment, the antibiotics should not affect the effectiveness of the vaccine. It is always advisable to consult with a healthcare provider if you have any concerns about your child's health.