Cultural and social cues too. British people, for example, frequently accuse people from a certain large Northern European country of having no sense of humor. Why? Well, because when they/we (I'm an ex-Brit) make sarcastic comments in front of them, said Northern Europeans take it seriously.
Now I have to assume sarcasm is fairly universal. I'd be surprised if aliens from the Planet Thargh IV are not familiar with the basic concept of "saying the opposite of what you mean because it's absurd, and finding humor in its absurdity". So the chances of said country not actually actually being familiar with the concept is pretty unbelievable.
More likely is that the transmission - the social cues, the way English speaking people exaggerate the first few words of a sarcastic sentence ("Oh a sarcasm detected. Well that's a useful invention!") to indicate that we're being sarcastic and not serious - is different.
There's another location where sarcasm just never seems to work (and, alas, I'm dumb enough not to realize it half the time): The Internet. Or rather, written text, where sarcasm is interpreted as stupidity more often than not. We've even developed cues to try to ensure it's not misinterpretted, from "/s" to fake HTML tags. Again, this suggests everything is about the cues.
Computers probably can detect sarcasm if taught the cues. It ought to be easy: look for cues, determine meaning of sentence, if cues present and interpretation in local context is absurd, call laugh().
Or raiseEyebrow(). Whatever seems appropriate for the lowest form of wit...