It seems like in most cases(at least, that I know of) where a population is conquered by foreigners for a long period of time, the local language survives either intact or mixed with the conqueror's language. For instance, English is heavily influenced by French, but still Germanic. Russian is Slavic even though the Kievan Rus was established by Vikings. French, Spanish, and Italian are all romance languages, even though the Franks, Visigoths, and Lombards were Germanic. Why didn't the same thing happen to Greek?
First off, it didn't actually replace Greek. Up until the end of WWI, and the later exchange of populations, there were huge populations of Greek, Armenian, Syriac and Arabic speaking communities in Anatolia, among others. There were many newspapers and books printed and published in Greek and Armenian throughout the 19th and early 20th century in the Ottoman Empire. The reason Turkish became so successful was the huge amount of migration from Central Asia. Mahmud al Kashgari, Jalaladdin Rumi and other historical figures who lived and died in what was the Seljuk Sultanate were from places in China and Northern India.
The reason the Anatolians started speaking Greek was originally the conquests by people like Alexander, cultural stuff like the Odyssee and the Greek trade colonies. It goes both ways. Trade was monopolised by the religious order of Ahi's and Sufi's, politics by the Turkish speaking dynasties such as the Seljuk and the Ottomans, religion by people like Jalaleddin Rumi