Yes, you can set up both. However, I don’t know why you would duplicate a set up.
Decide on your goal for doing so. If Shopify’s native GA4 is your primary set up, then the most common goal is get custom events, or send other supplementary data not supported in Shopify’s set up. That makes sense to set up both.
If you have any duplicating events, like page views, then send a non-interaction hit of true to avoid duplicate data that you’re worried about.