Can I defraud the merchant, or the merchant defraud me, on the bitcoin or lightning network? Suppose I am buying a smartphone from an online merchant I don't trust. Neither do they trust me. Suppose we're trying to defraud each other.
There are two attempted fraud scenarios I can think of:

The merchant attempts to defraud me: I pay X satoshi to buy a smartphone, but I never receive it, and I'm afraid the merchant will never deliver it to me.
I attempt to defraud the merchant: I pay X satoshi, and the merchant eventually delivers it to me; I then attempt to refund the X satoshi payment after physically receiving the smartphone. (This is assuming we're both using the Lightning Network).

Can these fraud scenarios be prevented in the Bitcoin network? Alternatively, if I decide to make the payment off-chain (i.e. Lightning Network), then how does the Lightning Network prevent these scenarios?
More importantly, is it possible to prevent both scenarios simultaneously?
It is a form of distributed transaction to pay BTC while &quot;simultaneously&quot; receiving physical goods. At the moment, I think that this type of distributed transaction is not achievable with the Bitcoin network or Lightning network alone. Will we still need to rely on the judicial system to settle this or perform some sort of rollback?
I'm not well-versed with the Bitcoin or Lightning protocol, so if someone can correct or explain to me, that would be great.
The merchant attempts to defraud me: I pay X satoshi to buy a smartphone, but I never receive it, and I'm afraid the merchant will never deliver it to me.

This is certainly possible, and Bitcoin-related scams like this happen all the time. If you're afraid of this, you really want to pay with Bitcoin, and you want to have some form of buyer protection, you should use a trusted third-party escrow service that will hold control of your coins until you confirm receipt of your smartphone, and the escrow can mediate any potential disputes. Most people in this situation would use a multisig wallet to keep the escrow themselves honest, but I don't think this is possible over Lightning Network (you'd need an on-chain transaction).

I attempt to defraud the merchant: I pay X satoshi, and the merchant eventually delivers it to me; I then attempt to refund the X satoshi payment after physically receiving the smartphone. (This is assuming we're both using the Lightning Network).

This is not possible with a completed Bitcoin transaction, nor over Lightning Network. Bitcoin transactions, once completed, are final.