No problem marrying on ESTA, leaving on time, then pursuing CR1/IR1 spouse visa later on. Even if your spouse-to-be files the I-130 petition for you 1 day, 1 week, or 1 month after your return to the UK, your US marriage will not be an issue for your future visa application. The key point is to stick to the terms of your ESTA, by not working while in the US and by making sure to leave before 90 days on every ESTA visit.