You can resign any time, and join any company you'd like. Your family-based EAD/GC processing is independent of where you work. You continue to maintain status based on a valid, non-frivolous I-485 filing (if this was employment based, the filing may have become invalid if <6 months passed since you filed, since the company was sponsoring you), and you are in what the USCIS terms a period of authorized stay - regardless of whether/where you work.