As long as it's clear that the aspect of the comic you're asking about is in some way related to science fiction or fantasy, and not romance, sarcasm, math, or language, I don't see why not.
If you look through the questions tagged xkcd, you can see a proud history of such questions:
Although these are fairly old questions (the most recent is from 2013), they're certainly not off-topic.
There needn't be any recognizable SFF work behind the comic for a question about it to be on-topic; I would liken those cases to our story-ID questions, which are contentious but largely accepted. As long as there are identifiable SFF elements (or good reason to believe there's an SFF inspiration), I don't see why such a question would be off-topic.
I would, however, caution you to do some basic research before asking your question. Lack of research effort is a common downvote reason, and the logic behind any XKCD joke can usually be easily identified by Googling some key words from the comic (the first question I linked to above is a great example).
If there's no clear SFFnal connection in the comic (as in the example posted in the comments), that would be off-topic. Such a question might be on-topic at the proposed comics.se (if that ever happens), but in the meantime would be better-served in chat.