1- Don’t always listen to rumors. If you don’t have certainty that this is the case, then ignore such rumors.
2- If the masjid sits on usurped land or the carpeting us usurped, then you cannot pray there. But if that’s not the case and some funding came from haram money, your prayer is still valid there