As others said, it's the passenger's responsibility to sort out travel documents and visas/ESTA before. If documents are missing, the airline will not be able to check you in. The US, in particular, is known for strict requirements and will fine airlines that fail to make sure all of them are met.
It's good practice to do online check-in the day before your flight so that you can spot and correct potential problems.