I'm currently on a J1 and planning on visiting Mexico during my grace period. I'd like to come back to the US afterwards. I know I can't reentry while on the grace period, so I need to get a B2 visa. It seems like visa applications are tied to US embassies and those obviously don't exist in the US. Is it possible to apply for a B2 while in the US?
As you've discovered, it's not possible to obtain a US visa whilst you are inside the US. For visas like B2 the only option is to apply at a US Consulate outside of the US.
Thus your only option would be to apply for the B2 whilst you are in Mexico, however be aware that the US consulate in Mexico normally has an extremely long waiting period to obtain an appointment for a visa, and if per chance your application was not approved then you would not be able to re-enter the US.
This presumes that you are not a citizen of a country that can use the Visa Waiver Program. If you are, then you will not need a visa to re-enter the US, and will be able to stay up to a further 90 days under the VWP.