Should "mayday" be preferred over "SOS" in an emergency?
SOS is a distress signal. In the context of aviation emergency calls it would be equivalent to a Mayday call, which is the standard voice signal for distress.

There is, as far as I'm aware, no standard equivalent for an "urgency" (pan-pan) situation in morse code. 



As far as its use in aviation, most aviation communication today is by voice (radiotelephone), and "SOS" is not generally used in voice communication.
Its used by morse code stations is because it is a short and easily recognized pattern:
. . . - - - . . .

Its recognizability is part of the reason it replaced the old Marconi CQD general distress call code
- . - . - - . - . - . .
which was literally a general call to all stations (CQ) signaling "distress" (D).

I can't find a reference, but I would assume there's at least one case in history where the SOS code was used by an aircraft (back when morse stations were common on aircraft).  

An SOS signal could of course be transmitted today using the unmodulated carrier from your radio by simply keying the microphone, but that would only be useful if the voice circuit of your radio has failed and you had no other means to communicate. Otherwise voice contact or setting your transponder to an appropriate code would generally be the preferred way to signal distress.