For example, if buyer uses a stolen credit card / hacked bank account for purchasing cryptocurrency on P2P exchange. In this case the seller will receive the fiat money, confirm transaction and cryptocurrency will be sent to buyer. But in theory, the real owner of hacked bank account may later notify a bank about this stole and bank may stop transaction or revert it. But P2P can't revert a Bitcoin transaction.
It's a good question. The majority of the replies above are referring to Coinbase or other centralized exchanges and therefore don't answer your question.
As darosior points out, most P2P exchanges will not accept credit cards since they allow very easy chargebacks, and most customers do not have the facilities or services set up to accept credit card payments. Most also won't accept payments from services like Paypal, which also allow easy chargebacks. Many will, however, allow bank transfers and other services in which chargebacks are possible, but with some limitations.
BISQ, as mentioned above, is my current P2P exchange of choice. You can read how they deal with this problem here:
https://bisq.network/faq/#chargeback-details. Essentially it comes down to only allowing small trades through these methods, and requiring accounts which use these methods to be older, established accounts, and requiring "signing" before using these methods (which essentially means the account is verified by a trusted trader first -
https://docs.bisq.network/payment-methods#account-signing). This set up essentially means anyone with a stolen bank account is going to have to wait several months and make a number of other trades first, just to be able to cash out a thousand or so dollars via BISQ. There are far less time consuming ways to cash out a lot more money from a stolen bank account, with less chance of being caught in the meantime. This means, as far as I know, BISQ have never had a chargeback via a bank transfer before.
Having said that, although those security measures are good, the bottom line is that you are responsible for your own security. There are plenty of payments options which don't allow chargebacks. If you have any doubts about a specific trader, then insist on a non-chargeback option or trade with a different user.