This is misinformation for any readers coming across this post. Show me one denial of I-130 for marrying in the US, especially when the person has left the US after.
@Daphne . is one of many who has married in the US as a tourist and then applied for CR1 abroad
And you do not need a permit to marry in the US. This is not the UK where you need a special visa to get married in the UK. Please stop spreading misinformation.
OP, your plan is perfectly fine. You can marry as soon as you enter as long as you depart back to your home country and pursue the CR1 visa.