Is there a way to A/B test the dynamic content to know which version works best?

Absolutely.

Create a trigger with an A/B Testing condition in order to test up to four variations. To A/B test dynamic content, you’ll have to use multiple triggers with conditions being the variations.