Can someone in cardiac arrest throw up while you are giving mouth to mouth?

Yes but... Currently the american heart association is recommending "hands only" CPR for cardiac arrest. That is no mouth to mouth. Giving mouth to mouth breathing does not improve outcomes ( while the chest compressions part of CPR does) the fear people may have about giving mouth to mouth breathing may prevent them from delivering needed help in a cardiac arrest. Consider learning the hands only cpr.
Sort of. If a patient is in true cardiac arrest (no pulse) then they are not able to truly vomit though passive regurgitation of stomach contents can occur (which is essentially the same thing only less forcefull). If you are concerned about this (and really, who wouldn't be)- use compression only cpr.