Yes, you can travel while your marriage-based green card is pending, but only if you have proper authorization. If you’re applying from within the U.S. (Adjustment of Status), you must obtain Advance Parole (Form I-131) before leaving the country. Advance Parole allows you to travel internationally and re-enter the U.S. without jeopardizing your green card application. Leaving the U.S. without Advance Parole will result in your adjustment of status application being considered abandoned, potentially ending your green card process.
If you’re applying through consular processing from abroad, you can generally travel freely until your immigrant visa is issued. Always keep in mind that any travel should be carefully timed to avoid delays or complications with your green card process.