There is no general rule preventing a nasal vowel from ever coming before another vowel. Sequences of a nasal vowel followed by any other vowel are rare in French, but not impossible. The examples I can think of all occur between words.
For example, "mission impossible" would be pronounced with /ɔ̃/ followed by /ɛ̃/. There is no consonant in between in standard French.
In contexts where liaison is mandatory or possible, the liaison may prevent such a sequence from arising between words. But the use of liaison is not just based on phonology, but also on grammatical structure and the identity of the specific words involved. (For example, "mission impossible" cannot have liaison because liaison between a singular noun and a following adjective is forbidden.)
As you mention, the liaison rule for the preposition "dans" is that it takes the consonant /z/ when it is used before a phrase starting with a vowel. This is traditionally classified as an obligatory liaison, although I believe I have read that there are some accents where it is no longer always made.
The liaison rule for "un" is that it takes the consonant /n/ when it is used before a phrase starting with a vowel, with no denasalization of the nasal vowel.
In some other words that end with nasal vowels, the vowel may be denasalized before the liaison consonant /n/. (I forget exactly which words these are, but Wikipedia provides a description that seems to agree with Stéphane Gimenez's comment below, and there is a separate question about this topic: How are nasal vowels denasalized during liaison?)
You just need to learn how each construction works. Liaisons don't all behave the same way.
Within a single word, when a vowel-initial suffix is used, an original word-final nasal vowel is generally replaced by a non-nasal vowel followed by /n/. See the examples "cancaner /kɑ̃kane/ from cancan /kɑ̃kɑ̃/; ronronner /ʁõʁɔne/ from ronron /ʁõʁõ/" mentioned by Eau qui dort in a comment on my answer to the Linguistics SE question "Which epenthetic sounds are most common to separate vowels?". So a word like "ronronnant" doesn't have a sequence of two nasal vowels; it is pronounced with /n/ (/ʁõʁɔnɑ̃/).
The specific example "Il se trouve dans un internat" would be transcribed as /ilsətʁuvdɑ̃zœ̃nɛ̃tɛʁna/ or /ilsətʁuvdɑ̃zɛ̃nɛ̃tɛʁna/.