On visa forums this method is commonly discussed. By entering on an ESTA/B-2 with the intent to marry a US Citizen, they're committing immigration fraud, inherently. You would be denied entry at the border if you admitted to your plans.
The correct way to do this is to file a K-1 visa outside the United States, or marry outside then file a IR-1/CR-1.