Canonical url for product with multiple categories
You should be able to use {{ entry.categoryFieldHandle[0].slug }}. The [0] simply grabs the first category in the field. 

You will need to make sure there is always at least one category allocated to an entry or you'll get an error.