Not only can someone with AB blood take type O, they are regarded as the universal receptor. They can take A, B, or O.. Pretty much anyone on the ship could have been a donor (disregarding the unknown Rh factor).
When Doc asks people to donate blood he only asks for donors with s blood type AB, without mentioning the necessary Rh factor, a critical point he shouldn't have ignored. (If the child's blood type is AB- he could easily die if the donor is AB+.) Alternatively, Doc could have asked for blood type O-, which is universally acceptable by everyone, regardless of their blood type.