Odin had domain over many, many things. Poetry, War, Victory, and of course Magic. Odin practiced a form of sorcery known as Seidr, and from what I can gather, the rest of the Gods did, too. Freyja was the one who taught Odin this particular branch of magic, and she also taught it to the rest of the Aesir as well.
The Gods weren’t the only ones who practiced Seidr. Several Norse folks did as well. Practitioners were both men and women, though women were more prominent. I don’t know if this is because there were actually more women practitioners than men, or if it’s because some men chose to practice in secret for fear that doing so in the open would bring upon social shame known as ergi (effeminacy).
I’ve heard that Odin actually dressed as a woman in order to learn Seidr from Freyja. Unfortunately, the only reference to this is in Loki’s Flyting, when Loki accused Odin of acting like a woman. But even then it’s just a two line thing where Loki mentions Odin was weaving spells like a sorceress.
My UPG and experience tells me this happened, that Odin did in fact do as Loki accused. Odin’s thirst for knowledge wouldn’t stop Him from doing that if it meant He could master the ways of witchcraft, and since He’s known as “God of” witchcraft/magic, it only makes sense in my mind that He would do this. Besides, He hasn’t indicated to me that this is a false claim.