As always, good outline in Wikipedia: Swastika
To summarise:
- Lots of ancient civilisations used the swastika as a symbol, because it’s an easy shape to draw.
- Because lots of ancient Indo-European civilisations used it (including Indians, Greeks, Celts, and Armenians), German archaeologists assumed it was a symbol of the original Indo-European people.
- OTOH the Chinese and the Navajo used it too, so that was not that good a guess.
- Because Indo-European may have spread through conquest, Germans assumed the original Indo-European people must have been kick-ass warriors, that they would be proud to call their ancestors.
- There might have been conquest, and there might have been cultural diffusion; who knows.
- The only name that looks like it might possibly have been a name for the original Indo-European people is Arya, shared between Indians and Persians. Hence, Aryans.
- Notwithstanding the general swarthiness of Indians and Persians, if the original Indo-European people were such kick-ass warriors. Germans concluded that they must have been blond, blue-eyed Germans.
- I shit you not.
- So if you want to extol the racial primacy of Germans, you will rally around the symbol that your glorious ancestors must have used—and by historical accident, that the Jews were one of the few peoples not to have made much use of.
So. Hinduism (and Buddhism, and Paganism, and the Navajo) came first. Then came guesswork about Indo-Europeans. Then came German racialist nationalism.