You should use lubrication on your flashlights for two main reasons:
1- To protect the threads.
The constant twisting action will grind down the threads over time. You minimize this constant wear and tear by lubricating the threads. To a lesser extent you also want to prevent the threads from galling. You can use most any lube for this including graphite, silicone, petroleum based oils/greases, etc. Even teflon tape will work.
Galling/seizing of the threads is generally not of big concern especially with aluminum since aluminum forms a protective oxide coating. Titanium and stainless steel, however, are more prone to seizing, but you should not worry unless you plan on leaving your lights sitting around for 20 years or so unused. The exception being the titanium screws used on the clips of some titanium lights. Those will probably seize over time unless anti-seize compound is used.
If your threads are gritty, this is bad. Clean them out thoroughly and then apply the lube of your choice.
2- To protect the o-rings.
O-rings are lubed to keep them pliable. If they dry out, cracken and stiffen, they would no longer serve their purpose. Choice of lube, gets more complicated because not all o-ring materials are the same.
The most common o-ring material is Buna-N which is a nitrile based rubber which is resistant to petroleum based oils. Other common materials are EPDM (another rubber type o-ring), Silicone (red-orange color) and Polyurethane (clear white color). The only lubricants compatible with all of these materials are perfluorinated, Teflon type lubricants like Krytox. Silicone based lubricants are a close second and are compatible with all the aforementioned materials except for silicone.
But don't take my word for it. Look up o-ring chemical compatibility on google. Here is a
link to the makers of Nyogel, Nye lubricants, which discusses chemical compatibility. Examine the lower left table. Note, perfluoropolyethers are Teflon like compounds, Buna-N is a.k.a. nitrile and the Nyogels 779 and 760 are synthetic hydrocarbon based gels.
In reality though, for our use in flashlights, it probably really does not matter what you use, as long as you use something. It is not like your o-ring will instantly decompose if you use an incompatible oil or grease on it. We are talking long term effects over the course of years. Chemical compatibility becomes much more important in higher temperature and pressure processes encountered in industry. However, I suspect for o-rings that are actuated constantly, like the ones used in the popular piston drive lights, it becomes more important to use the correct lubricant. It is also important to use the correct type of lubricant if you want to ensure the water proof rating of your light if you are a diver.
In summary, use a Teflon (perfluoro) based oil or grease on both your threads and o-rings. If you do not have silicone o-rings, you can safely use a silicone based oil or grease. If you have a current favorite oil or grease, go ahead and continue using that, it is much better then using nothing at all. Just keep an eye on your o-rings for extra wear and tear.