A structural Auger spectroscopy study of MgB2 thin (~140 nm) oxygen-containing polycrystalline films produced by magnetron sputtering and 99% dense MgB2 bulks synthesized at 2 GPa allows us to conclude that jc of MgB2 depends to a high extent on the amount and distribution of oxygen in the material matrix. jc reached 7.8-2.7 MA/cm2 below 1T at 20 K in the films and 0.3-0.9 MA/cm2 (depending on the boron used) in the bulks. The higher jc in MgB2 thin films can be associated with finer oxygen-enriched Mg-B-O inclusions and their higher density in the film structure compared to the bulk. Calculations of the total electron density of states (DOS) in MgB2, MgB1.75O0.25, MgB1.5O0.5 and MgBO showed that all the compounds are conductors with metal-like behaviour. The DOS is even higher in MgB1.5O0 5 than in MgB2 and the binding energy is similar. So, the experimentally found presence of some dissolved oxygen in MgB2 does not contradict its high SC performance. The introduction of a high amount of oxygen into the MgB2 structure does not dramatically reduce the material's Tc and allows obtaining highjc as observed in our MgB2 films and bulks.