主人 means 'master', so you shouldn't use it to refer yourself. When used by man to refer his relationship with his wife it feels rough, be careful. 主人 is polite when your wife refers you because it is considered as humbleness. Also it implies he is a bit serious person. This can be used by woman to introduce her husband in formal situation.
旦那 is almost similar to 主人 but implies he is somewhat rich, friendly and easy going person. This word is used by woman to introduce her husband with some friendliness to him and others listening to her speaking. Also used by man to refer other married man with friendliness.
夫 is normal. This word is safe to use always. Can be used in formal situation. To refer yourself as husband of someone, this word is almost only one you can use. To refer husband of other woman, this word somewhat lacks feeling of personal friendship to him, but safe.
To refer husband of other woman, 旦那さん is friendly and with some respect. To add more respect use 旦那様 or ご主人. They can be used in formal situation. You shouldn't use bare 主人 or 旦那 to refer other woman's husband because it lacks respect to him and his wife.
Also some people uses word 相方 to refer their husband/wife. This word can be used by woman to refer her husband, or by man to refer his wife. This word's feeling is friendliness and equality between them. But it is not very formal.
In corner case which you want to completely remove feeling of sexism, you can use 配偶者 to refer your wife. This word can be used by woman to refer her husband. But in Japanese society it is very rare. In almost case using 配偶者 feels like someone is taking too much care about sexism.