Some scholars are of the view that this wealth is haraam only for the one who earns it, but for the one who takes it from him in a permissible way, it is not haraam for him, such as if your father gives you a gift or spends on you and so on.
Shaykh Ibn ‘Uthaymeen said: Some of the scholars said that in the case of wealth that is haraam because of the way in which it was acquired, the sin is only on the one who earned it, not on the one who takes it in a permissible way from the one who acquired it. This is unlike wealth that is haraam in and of itself, such as alcohol, wealth seized by force, and so on. This view has a strong basis, because the Messenger (peace and blessings of Allaah be upon him) bought food from the Jews for his family, and he ate from the lamb that the Jewish women gave him in Khaybar, and he accepted the invitation of a Jew, even though it is well known that most of the Jews consume riba and haraam wealth. Perhaps this view is further supported by the words of the Prophet (peace and blessings of Allaah be upon him) concerning the meat that was given in charity to Bareerah: “It is charity for her and a gift from her to us.” Al-Qawl al-Mufeed ‘ala Kitaab al-Tawheed
Shaykh Ibn ‘Uthaymeen said: With regard to that which is haraam because of the way in which it is acquired, such as that which is taken by means of deceit, or by means of riba, or by means of lying and so on, this is haraam for the one who acquires it, but it is not haraam for anyone else if he acquires it from him in a permissible manner. This is indicated by the fact that the Prophet (peace and blessings of Allaah be upon him) used to deal with the Jews even though they used to consume haraam wealth and riba. This indicates that it is not haraam for anyone other than the one who acquired it. Tafseer Soorat al-Baqarah
more @ https://islamqa.info/en/45018