In programming, no two things ever happen simultaneously. The opponent draws first.
Note that if the opponent has two cards and you have just one, then you will deck out. However, the opponent cannot be decked out directly by the card - they just stop drawing (of course, they'll lose after you finish your turn if their hand isn't full). In other words, if you both have only one card left, no one will lose immediately, as you'll both only draw that one card.