Why do dictionaries transcribe the nasal in 'think' and 'language' with /ŋ/, yet 'input' and 'inbox' with /n/, not /m/?
Solution 1:
The standard basic phonemic analysis that I am most familiar with is that the words "think, tinker, language, English" contain the phoneme /ŋ/. I have see some more theoretically complex analyses that treat /ŋ/ in English as a "non-basic" sound that is always underlyingly derived from something else (depending on the context, either n or ng), but you'd never see that kind of analysis used for dictionary transcriptions.
This phoneme happens to be represented by the letter <n> in these words, as English doesn't have a letter that represents /ŋ/. That's just a fact about the orthography. As Peter Shor points out in a comment, the letter <n> doesn't always represent the phoneme /ŋ/ before a velar consonant – it's also possible for it to be /n/, in which case a dictionary will likely transcribe it as /n/.
There is a phonotactic constraint in English that forbids /np/ or /nk/ as a phoneme sequence within a single syllable. The word think (as I said, I’m assuming a dictionary-level type of phonemic analysis, not a more abstract theoretical one) isn’t pronounced with the phone [ŋ] as a result of phonetic assimilation of /n/; it is pronounced with [ŋ] because it has the phoneme /ŋ/.
(In the more complex theories, it seems what I'm calling "phonetic assimilation" here might instead be called "gestural overlap"; see http://idiom.ucsd.edu/~bakovic/work/bakovic_local-assim.pdf which uses the word "assimilation" to refer to a phonological process and "gestural overlap" (in note 3) to refer to the process that produces phones like [ɱ] before /f/ in "casual speech". This may be a more correct use of the word "assimilation"; I'm not sure. If you use "assimilation" in this way, then "In English, coda nasals assimilate to the following consonant" seems to be false when interpreted as an unbreakable rule).
However, /n.p/ and /n.k/, with a syllable break in between, are generally considered possible in English at the level of phonemic representation. Their phonetic realization is actually variable, because place-assimilation of /n/ doesn't always occur.
It's hard for me to think of a possible minimal pair between /n.k/ and /ŋ.k/ or /ŋk./, but perhaps "kin-killer" vs. "king-killer" would do. (This doesn't work as a minimal pair for everyone, because some North American speakers have apparently phonemicized a difference in vowel tenseness for "i" before /ŋ/, realizing kin as /kɪn/ but king as /kiŋ/).
Nasal place assimilation/“gestural overlap” in English is optional and doesn't always result in complete neutralization of phonemic place contrasts
The nasal assimilation in input and inbox is in principle optional. In practice, I believe it may be phonetically realized in a gradient rather than a categorical fashion, leaving behind phonetic traces of the identity of the original consonant.
Here is a source that mentions and summarizes this:
Articulatory studies have shown crosslinguistic differences in across-word nasal place assimilation. The categorical versus gradient nature of assimilatory patterns is presumably phonologically conditioned: languages with larger nasal coda inventories show gradiency; those with more restricted inventories display categorical patterns. [...] English [has a] 3-way labial-alveolar-velar nasal contrast and a preference for gradient and variable nasal-to-stop assimilation (e.g., Ellis & Hardcastle, 2002)
(L1 influence on L2 assimilation: An EPG study of English /n/+stop sequences, Laura Colantoni, Alexei Kochetov & Jeffrey Steele )
I can't access Ellis & Hardcastle (2002) right now, but here is the abstract:
Place assimilation in English is now widely considered to be a gradual phonetic, not categorical process. This view is partly based on previous EPG evidence of partial alveolar assimilations which lack complete stop closure on the alveolar ridge but show a residual tongue blade/body gesture. This study reports EPG data from 10 speakers producing, at varying rates of speech, two experimental sequences, /n#k/ and /n#k/ (the latter a lexical velar–velar sequence with which apparent cases of complete assimilation can be compared). In fast speech, four distinct assimilatory strategies were identified. Two subjects never assimilated, four always assimilated in what appeared to be a complete fashion and the remaining four were the most interesting, showing considerable intra-speaker variability. Two of these four produced the expected continuum of assimilatory forms including partials. Unexpectedly, the other two produced either full alveolars or complete assimilations in the manner of a binary opposition. Follow-up EMA analysis yielded no evidence of the reduced coronal gestures found to be absent in the EPG-only data for two the speakers who, when they assimilated, did so in a complete fashion. Although no claims are made regarding higher-order representations, we interpret this as evidence of marked individual differences in assimilation strategy.
Categorial and gradient properties of assimilation in alveolar to velar sequences: Evidence from EPG and EMA data. Available from: https://www.researchgate.net/publication/223917010_Categorial_and_gradient_properties_of_assimilation_in_alveolar_to_velar_sequences_Evidence_from_EPG_and_EMA_data [accessed May 28, 2017].
So basically, it's variable: the realization could be anything out of [n], [m], [n͡m]. It's also predictable if you know about English phonetics, and something that native speakers will do naturally and so don't need to be told about in a dictionary.
Assimilation in in- prefixes
The situation with the negative prefix in- is complicated; I would think in part because there is no orthographic difference between the representation of the phoneme /ŋ/ and the phoneme /n/, so it's easy for a reader to extract either pronunciation from the spelling. Since in- occurs mostly at the start of Latinate words, words with this prefix will on average belong to a higher register of speech that is more influenced by spelling.
The OED shows variants with /n/ and /ŋ/ for the word income.
"Phonological Features of in-, un- and non-", by Akira Okada (2013), cites Edward Carney's Survey of English Spelling (1994) as saying that “there is free variation between /n/ and /ŋ/ in prefixes ending in ‘n’”.