There’s a faq on this on the site (find it yourself). It was created as an unpronounceable “acronym” (although it doen’t stand for anything) and the domain came later when Randall was still an unknown. It’s old enough that a lot of “normal” domain names were still available, but the name itself was one of the jokes.
Possibly, although the official explanation is that it's "just a word with no phonetic pronunciation". There's a "What does XKCD stand for?" section on the About page. https://xkcd.com/about/
Randall wanted a unique short string associated with all his work. That way he could Google "xkcd" and find everything he ever did online. I believe he had a script that generated all possible 4-letter combinations and filtered out ones with any search results, and settled on "xkcd". But he became a victim of his own success when the comic became so popular and "xkcd" is now synonymous with the comic.