My best understanding of a typical "right of first refusal" clause is that it gives the company the right to match any offer by a third-party buyer.
This would add some friction to the transaction, in that the company could have some specified period to consider the offer, leaving the pending transaction with a third-party buyer in limbo (or discourage the third-party from even considering the transaction). But if the company refuses to buy back the stock at the terms of the third-party offer or the period of time for the company to consider the offer expires, then you could go ahead with the sale to the third-party.