I have heard that glue won't stick well on oiled wood, is this true?
Yes that's right. The oil resists the glue intermingling with the surface wood fibres which prevents the formation of a proper bond with the wood. This is true with all glues, but is particularly a problem with waterbased glues such as PVA (both white and yellow types).
Is there any special kind of glue that works better, or a treatment I can apply to get it to stick better?
Generally you either degrease the wood or you remove some material from the surface to expose fresh wood.
You can degrease by literally washing the wood down with warm soapy water but it's often done these days by wiping down with organic solvents. If you're thorough with either method you will eventually get an oil-free surface suitable for glue, but it's arguably a better idea to physically remove the oil-contaminated wood (ideally by planing it off with a hand plane).
On long-grain surfaces oil won't have soaked very deeply into the wood — even "deep" penetration is merely tenths of a millimetre/hundredths of an inch on long-grain surfaces — but this is still quite a bit of material to remove by sanding which is why it's probably not a viable method. Planing or scraping are far faster and leave a better glue surface anyway.