Modify Commerce Product before saving
If you want to alter the validation you can use hook_form_alter to add/alter the validation handlers used for the form.

To change the product you can use one of the entity hooks: hook_entity_insert is probably the one you want to use, but there also is one for update, presave and delete, and they also exist in a variant specific for commerce products: hook_commerce_product_insert