We can only speculate about the exact underlying nature of the "foreign phoneme"; on the other hand, its surface realization is obvious, [tt] or [ss].
Below is my summary of the most relevant research on this problem.
Everyone agrees that θάλασσα is Pre-Greek (i.e. not IE), one of the reasons being that there were no geminates either in the PIE or in Pre-Greek (Beekes, Brixhe etc.).
As Stephen Colvin (Colvin 2007) writes, "the prehistory of these clusters [i.e. obstruent +y, Alex B.] is complex and much disputed" (p. 26). That being said, the communis opinio seems to be that the underlying consonant to be a palatalized velar, e.g. *-χyᾰ (Lejeune 1972, §98d) or *kʲᾰ (Beekes, kya in his notation); cf. Macedonian (?) θαλάγχα(ν).
Bubenik 2017 offers a very clear and a rather compelling account of how this might have happened. He writes that dental and velar palatalization, with subsequent affrication, happened in Proto-Greek:
*tj > *t'j > *t's'j
*kj > *k'j > *t's'j (in his notation).
The palatal glide was later lost, the palatal affricate was depalatalized and merged with Proto-Greek *ts.
This cluster, Bubenik writes, "could be subject to progressive assimilation ts > tt (in Boeotian, Attic and Central Cretan) or to regressive assimilation ts> ss (in other dialects)' (p. 647). Thus, he classifies all the dialects into the following groups:
- Arcado-Cretan and Ionic: PG *k(h)j, tw > ss; PG *t(h)j, *ts and *ss > s;
- Aeolic and West: all of those > ss;
- Attica, Euboea, and Boeotia: PG *k(h)j, *tw, and partly **t(h)j > tt.
He speculates that tt "could have belonged to the Aeolic basilect, surviving in Boeotian (and extended to [Western?] Attic), but eliminated partially in Thessalian and wholly in Lesbian" (p. 648).
cf. "geminate tt in Attic is a reflex of part of the palatalization isogloss shared with Boeotian and Euboean, corresponding to the geminate ss of Ionic and other dialects: cf. lexical forms like thálatta ‘sea’, glôtta ‘tongue’ vs. Ion. thálassa, glôssa, or verbal formations like *eret-jō > eréttō ‘I row’ (cf. erétēs ‘rower’), *kāruk-jō > kērúttō ‘I announce’ vs. Ion. eréssō, kērússō" (Angeliki Malikouti-Drachman, “Phonology (Survey)”, in: Encyclopedia of Ancient Greek Language and Linguistics, 2013).
If you are interested in more dialect data, feel free to peruse Thumb and Scherer or even Meister.