I bought bitcoin through the atm machine, it was sent to me but is yet to be confirmed over 52hrs.. if the transactions later disappeared from the mempool / blockchain, how will the sender get back the fund, since not send from a wallet?
In this case, you would need to contact the ATM operator / service provider, and provide them with some proof of your purchase and the failed transaction. When completing your interaction with the ATM, you should receive some sort of receipt that details this information, though the exact specifics will likely vary from one ATM to another.
If you are running a full node, perhaps you could find the transaction which was supposed to pay you in your node's mempool, and then save it to be rebroadcast in case of an extended period of non-confirmation.
But I think that in most cases, you will just need to contact the customer service department of the ATM operator, and request that they complete the transaction.