As the error states, you cannot specify related fields in the inner SELECT statement -- you can only specify fields that are in the object itself.
There is a Product2Id field in the OpportunityLineItem object (see documentation) so you should be able to use this field:
SELECT ContentDocument.Id FROM ContentDocumentLink WHERE LinkedEntityId IN
(SELECT Product2Id FROM OpportunityLineItemsOpportunityLineItem WHERE OpportunityOpportunityId = '{pv0}')