Would a hole in a heart instantly make it unsuitable for transplantation? Or could it be possible for a heart with a congenital defect to still be suitable for use is someone else's body?
I am assuming you are referring to a patent foramen ovale.
A Google Scholar search for donor heart "patent foramen ovale" returns many results about transplanted hearts with PFO, which suggests to me that this is not a contraindication for donation, though that may be up to the transplant team or hospital. In most cases, PFO is not symptomatic; it could also be potentially repaired at the time of transplant if it was deemed significant.