It's more complicated than that. Mozart was following a "Turkish"/"Janissary" style of music popular in Europe at the time. Indeed the style was pretty much unrelated to actual music from Turkey, but there's a history of how it developed that started with Turkish Janissary bands. (More obviously in orchestral "Turkish" music than in Mozart's piano sonata, where compositions used exotic instruments like bass drums.) https://en.wikipedia.org/wiki/Turkish_music_%28style%29
https://www.youtube.com/watch?v=MNtYYuWILNE