There are many different apps on the App Marketplace for this purpose.
So yes, you can do affiliate marketing on Shopify!