The order of the products under the opportunity wouldn’t be synced in the same order to invoice unless the changes are made in the advanced query builder of the DBSync.
Navigate to products under opportunity.
Click on the dropdown present on the rightmost top corner.
Select the Sort Products button.
Drag the products into the order you want and save.
Make the necessary changes mentioned below in the Advanced query builder section
for the respective project after logging into your DBSync account.