Both variants are correctly and practically there's no difference in this case. Wie auf einem Flohmarkt functions as an adverbial phrase, in one case modifying the verb aussehen, in the other case the whole sentence.
First, compare:
- Die Sonne geht schnell auf: schnell modifies aufgehen
- Die Sonne [geht [wie gestern] auf]: wie gestern modifies aufgehen
- [Die Sonne geht auf] [wie gestern]: wie gestern modifies die Sonne geht auf.
- Wie gestern geht die Sonne auf: not clear, whether wie gestern modifies die Sonne geht auf or aufgehen
Interestingly, an adjective used as an adverb can modify the sentence only in the beginning, not the end: you can say schnell geht die Sonne auf, but not *die Sonne geht auf schnell. This leads me to conclude that adjective-adverbs cannot modify sentences.
Additionally, the adverbial phrase can also just seem to modify the preposition: die Sonne geht auf wie gestern, und unter wie vorgestern.
Now, in your specific case, aussehen is more complicated and has a special idiomatic structure: it requires an adverbial phrase as an argument. With wie, this phrase can take both of the slots, as shown above (you cannot say something like Hier sieht es aus., unless in special elliptic constructions):
- Es sieht [wie auf einem Flohmarkt] aus
- Es sieht aus [wie auf einem Flohmarkt]
But you can also have other adverbials:
- Es sieht aus [als ob das ein Flohmarkt wäre]
- Es sieht [nach einem Flohmarkt] aus
- Es sieht [ganz gut] aus
Here, the other position in all cases would be wrong.