In fact, if significant, this is so overwhelmingly likely to be the initial cause that secretive purging behaviours (e.g. in bulimia nervosa) should be suspected if vomiting is denied. In a hospitalised patient, nasogastric drainage can give you the same effect.
Of course there are other causes though.
In the case of vomiting, you get a metabolic alkalosis because you are losing hydrogen ions and chloride ions from the stomach (remember, it contains hydrocholoric acid - HCl). The hydrogen ions need replacing, and this will cause a metabolic alkalosis on its own, but chloride also contributes via a more deviantly indirect method. Hypochloraemia means that less sodium can be absorbed proximally by the kidney (the two are absorbed together). This means that the sodium load to the distal parts of the kidney is increased. The body, desperate to reabsorb the sodium (to thereby reabsorb the water too), has no option but to take in the extra sodium at the cost of excreting more potassium and/or ... hydrogen. Thus, vomiting is typically characterised by a hypochloraemic, hypokalaemic metabolic alkalosis.