Upvote:4
It is not possible to apply for a B2 visa whilst in the US - it must be done at a US Consulate outside of the US.
There is a process for extending a VWP stay by up to 30 days in the event of an "emergency". The process is described on the CBP website, and will involve contacting the nearest USCIS Field Office, which can be found on the USCIS website.
Depending on the exact situation it's very possible that this would not constitute an "emergency", but contacting the USCIS to request an extension doesn't have a downside so it's worth at least trying.