You absolutely can, if you are actually dealing with people listening, because sarcasm is signalled with (among other things) tone (the other things include the listeners contextual knowledge of the speaker.)
You can't do it online, in text, where the audience is mostly strangers who would have to actively dig into your history to get any contextual sense of you as a speaker, because text doesn't carry tone, and the other cues are missing, too.
And by “you can’t”, I mean “you absolutely can, but you have to be aware of the limitations of the medium and take care to use the available tools to substitute for the missing signalling channels”.