Alkanes cannot be directly iodinated because the reaction is reversible and fails to produce alkyl iodide. This is because, the by product HI formed is a very strong reducing agent and reduces the alkyl iodide back to alkane.
To prevent the reversibility of the reaction, we add strong oxidising agents like HNO3 or HIO3.
For the alkyl to be iodinated, we can use the halogen exchange reaction (Finkelstein reaction).