If more than half of their wealth is certainly haram, it would not be permitted to eat at their house in the Hanafi school. [Ibn Abidin; Hindiyya]
If they are close relatives or in other cases of genuine need, one may take a dispensation from the Shafii school when there is a need and eat if the food itself is halal and at least some part of their wealth is halal (which is almost inevitable).
This dispensation should be avoided, however, when there is no need. The Prophet (Allah bless him & give him peace) said, “Whoever avoids the doubtful safeguards their religion and honor.” [Bukhari and Muslim]