You can absolutely adjust status from B2 to O1 while in the Unites States.
If your petition is approved it will say whether or not your status is considered adjusted. If it is, you'll only need to go to a consulate to get a visa if you need to leave and re-enter the US for another reason.
Good luck!