To hopefully answer your question,
First of all, the air that is in the cabin isn't filty or germ ridden as you have inferred.
Air is indeed drawn from the engines, but nowhere near the combustion end of the engine. It is drawn from the compressor section. It is then brought from here to an air conditioning pack(air conditioning unit). The air is cooled at this point by an air cycle machine, (by means of volume expansion) and in then put in to an air mix manifold.
At this point, some cabin air, up to 20% is mixed with the freshly introduced air, and circulated in the cabin via riser ducts. The air then mostly escapes to the atmosphere, and some is brought back to the air mix manifold.
Ultimately, you will have a full cabin air replacement every few minutes, depending on the size of the aircraft.
During this process, the air is passed through a HEPA filter that is regularly replaced.
With regard to your concern on contamination of the cabin air from engine oils etc, as the air is drawn from the compressor stages of the engines, there is very little cbance of engine oil or hydrocarbons being introduced. The air is passed through several stages that would cause any contamination, no matter how small to be prevented from reaching the mix manifold.
If you want some more specific information on any of these stages, please ask the question,
Cheers
D