There are dissolved oxygen sensors. But they are for use in water. I don't know if they work when there are many other things, for example inflammable gasses.
As you can see, it is not cheap, but those are normal prices for dissolved oxygen sensors.
You have to consider the definition of soil. If you mean the solid part then the oxygen content is already defined by the chemical makeup of the material. If it's the liquid or gas within the material then it can be measured with an appropriate detector.
jremington:
The entire process of composting, including which organisms are involved, depends very strongly on whether oxygen gas (air) is added to the mixture.
What are you actually trying to measure?
An oxygen reading in the centre of the compost pile, to ensure sufficient oxygen is found throughout the pile. Do you know if such a sensor exists?