At least wait until you get the offer letter. Once you get the offer letter, you can politely ask if the company is willing to sponser greencard for you. They either say yes or no. But normally they would not withdraw the offer letter just because of this. By the way, you need to make sure that will sponser your H1B first.