Order's reference number and product's code are used to identify them in myOGO. In order to avoid problems with orders, each one's reference number must be different among your data. Same applies to each product's code, they all need to be different. Normally these references are automatically set with different values based on integration and there is no overlap.
In rare cases two orders might end up with same reference number. If two orders have the same reference number, the order that came later will be put to RESERVED state. Order must be then requested to be moved to DRAFT state from order's page with Request to modify order button. When the order is changed to DRAFT state, the reference number can be changed. Once the order is in COLLECTING or SHIPPED state, the reference can not be changed any more.
If two products have the same code, there is no way to differentiate them when updating data to the warehouse. Product codes are often automatically fetched from web store and normally there are no duplicates. If duplicates occur, these fields can be edited manually in product's edit page.
In some cases one product is in myOGO with different names and there are multiple instances of the same product. In these cases reference number still needs to be different. Normally EAN (European article number) code should also be individual, but in these cases it can be same, since it is referring to same product.