Let us consider two scenarios as mentioned bellow:

Refund is issued to a cancelled debit card/ credit card

If your refund comes through a debit card or credit card that you have cancelled just because of some fraudulent activity, the bank will sanction the refund amount into your account that is linked to the same debit card/ credit card number, as the account number is still active.

If the bank declines the transaction on your closed credit card and returns the fund to your merchant, your merchant will be notified in such situation. Meanwhile, you can check with your merchant if they can arrange for an alternative method to refund your money.

Refund is issued to a Closed Bank Account: If your bank account is closed, the funds will stay as an incomplete transaction and will be waiting to be paid at the bank level. You will have to contact the issuing bank and follow up to arrange for other possibilities to receive funds - via cash, cheque etc. Sometimes, the bank will ask you to submit the refund request in writing.