If a young child is put on medication for an ear infection, is it normal for the ear to drain mucus?

Possibly. If the ear drum has ruptured from the ear infection - which is not uncommon.. Then yes you would see drainage from the ear. If there is a rupture (typically very small - pinpoint), it will heal within a week. The medication (i presume an antibiotic) did not cause the drainage.
Ruptured ear drum. An ear draining mucus suggests a ruptured eardrum/perforation. Contrary to what you might think, this is not a bad thing. The pain associated with the ear infection usually goes away, and the draining pus can also speed the resolution of the infection, they close spontaneously. The doctor will usually add antibiotic ear drops and will want to reexamine the ears, and confirm the hole closes.
perforation. If fluid is coming out of the ear canal, this usually means that the ear drum has perforated from the ear infection. This does not mean the infection is necessarily more serious and the perforation heals very quickly. If your child is not better in 48 hours after starting antibiotics, you should return to the pediatrician for re-evaluation.

Related Questions

If a young child is put on oral medication for an ear infection, is it normal for the ear to drain out stuff?

Yes and No. It is not normal because it doesn't happen with every ear infection, but it is not unexpected. It is most likely that the ear infection has created a hole in the ear drum (performation)... Like a popped zit (sorry for the visual). Most perforations related to ear infections will close within 3-4 days. There is no urgency in getting this looked at, but on next visit.. The pediatrician can take look. Read more...
Not rare. If there are tubes in place or if the ear drum ruptures then pus will drain out. This is not rare and not necessarially an ominous sign. Read more...