Transaction selection is the prerogative of miners, and specific behavior in regard to unconfirmed transactions cannot be enforced on the network as it precedes the consensus mechanism (block creation). Therefore, as chytrik states, it's completely up to the miner who succeeds at creating the block.
However, in December 2020, the prevalent transaction selection behavior by miners still appears to be "first-seen safe". Most nodes on the network also do not forward doublespend transactions, so a conflicting transaction would likely need to be submitted directly to a miner that does not adhere to first-seen safe selection. On the other hand, a network participant would not be able to reliably know whether any miners are attempting to include a doublespend until the block is published.
Even so, I'm aware of some businesses that conditionally accept transactions before confirmation. They rely on risk assessment based on factors such as feerate, amount, existence of a customer relationship, and probably more. I do not recommend accepting transactions before confirmation without risk assessment in place.
Note that opt-in RBF (see: BIP125: Opt-in Full Replace-by-Fee Signaling) transactions are explicitly unreliable before confirmation as the sender may overwrite them at-will. Opt-in RBF transactions MUST NOT be accepted before confirmation.