Vacancies are a kind of lattice defect, and defects would always be there in a practical material. Their concentration depends on the type of material, thermal conditions and reactants partial pressure. It is possible to tailor (increase or decrease) the concentration by applying proper synthesis conditions.
One nice and easy to understand example showing why O vacancies can exist in an O containing atmosphere at elevated temperature: Titanium spontaneously forms a TiO2 oxide layer on its surface once exposed to air (even at room temperature). Once you heat it up, above approx. 600°C TiO2 partially transforms to Ti2O3. If you look at the metal sub lattice of the oxide, you will then have coexisting Ti 3+ and Ti 4+ ions. If you have two Ti 3+ ions (which were Ti 4+ before) you create an O vacancy as the 2 Ti 3+ ions will only be able to trap 3 O atoms instead of 4 in TiO2. The O atoms from outside will diffuse through the oxide layer along the vacancies and (1) oxidise the metallic Ti at the metal oxide interface and/or (2) will be dissolved interstitially in the Ti metal matrix as energetically favourable compared to filling the vacancies. Hence, the O vacancies will still exist.