Their meaning is usually the same, and both are equally natural. You can also say "by looking only at the clothes" and "by looking at only the clothes", and those are also natural.
The meanings can be different, because phrases with only are often syntactically ambiguous: only could apply to more than one part of the sentence, so it's not clear which part is in question. Only usually applies to the first thing after it, but it can also apply to the last thing before it instead:
- "Would you know if a shop was a woman's or man's only by looking at the clothes?" could be "... (a woman's or man's only) by looking..." or "... (only by looking ...)".
- "by only looking..." could be "by (only looking) ..." or "by only (looking at ...)": the first specifies looking, not looking plus something else (touching?); the second specifies looking at the clothes, not something else.
- "...by looking only at the clothes" is presumably "by looking (only at the clothes)", but it could also be "by (looking only) at the clothes".
- "...by looking at only the clothes" is unambiguous.
This sounds hopelessly ambiguous, but often the difference doesn't matter, or only one interpretation makes sense. In this sentence, only (looking at the clothes) is the most likely interpretation, so the ambiguity isn't a problem.
(However, "...by looking at the only clothes" means something very different: it implies that there aren't any other clothes, and that this is noteworthy. (Maybe you expected more clothes. So this won't work for this sentence.)