[This probably isn't the most linguistically rigorous explanation, but I've found it to be the most helpful way to conceptualize the phonological rules involved.]
No, it depends on the exact phonetic structure of the word. Examples where an initial I succeeded by M is pronounced as a nasal (/ɛ̃/) are:
- importun ([ε ̃pɔ ʀtε ̃] or [ε ̃pɔ ʀtœ ̃]
- important ([ε ̃pɔ ʀtɑ ̃])
- imbriquer ([ε ̃bʀike])
Similarly, initial I succeeded by N may sometimes be pronounced as /i/, the non-nasal I:
- inaperçu ([inapε ʀsy])
- inactualité ([inaktɥalite])
(Pronunciations taken from the TLFi.) The general rule that I've observed is that the succeeding syllable is normally in a CV(C) structure. (In other words, the vowel of the syllable is to be preceded by a consonant, but a successive consonant is optional.) The initial in- or im- cannot be treated as a nasal vowel if the M or N is needed to supply the succeeding syllable with an initial consonant. To illustrate this with examples:
importun: the syllable structure is im-por-tun. The vowel of the second syllable is preceded by /p/ so the M is part of the first syllable, and the first syllable is a nasal vowel.
immense: for the purposes of this analysis, the syllable structure can be written as i-(m)men-se. The M is need to supply the second syllable with an initial consonant, so I is not pronounced as a nasal vowel.
inconnu: the structure can be written as in-co-(n)nu. The consonant C is already attached to the second syllable. The N belongs to the first and the initial consonant is a nasal vowel. (Notice that this rule also explains why the vowel in the second syllable isn't nasal.)
inaptitude: the structure is i-nap-ti-tu-d(e). The N has to be attached to the second syllable as the second syllable will otherwise have no initial consonant. Thus, the I is not nasal.