[deleted]
The history of the story of Aladdin is complex because it is one of the "orphan" stories that appear in the supplemental nights and was not, consequently, part of the original stories woven together by the Scheherazade frame. That said, it should come as no surprise to find a folktale from anywhere set in what is locally seen as exotic: in this case, "China" is a way of saying "in a far away land." At the same time, it is not unusual for a folktale to fail to depict details of an exotic setting in an accurate way. Typically, the exotic place has specific details that are more reminiscent of the place where the story is told than of the place where the story is supposed to unfold.
To simplify matters when depicting the story in film, the very Arabic features of the story - as you mention, sultans, viziers, bazaars, etc. - are best not confused by a Chinese setting. While western China has an Islamic population, it made more sense to move the setting to Arabia for the various film depictions of the story.
The Aladdin story is Tale Type ATU 561 (with affinity for ATU 560). It has a wide distribution in Europe and the Middle East. In the various tellings, setting is the first to be affected by local perspective and preference. One should not take the Chinese setting of the version appearing in the "Supplemental Nights" too seriously; other variants have other settings.
edit: a fair response, which has since disappeared, asked about the classification system ATU: The point here is not the classification in itself, but rather the fact that the folktale can be classified. It is ubiquitous and has caught the attention of folklorists for a long time. The ATU classification system was originated by the Finnish scholar, Antti Aarne. It was amended by the American Stith Thompson and then most recently by the German folklorist, Hans-Jörg Uther (hence the ATU).