I'm not sure about which part of Margaritaville you're asking, but the restaurant is open to the public. You have to go through the gate and get a parking tag to hang on your car. I assume the beach is also public, as are all beaches on the island, but the use of the chairs/lounges and other beach stuff, as well as the pool and other resort amenities, is for the use of the resort guests.
I reached out to the Margaritaville in St Thomas, email back below:
The restaurant is open to the public. It is best that you make reservations if you are coming for dinner.
6080 Estate Smith Bay
St Thomas, USVI 00802
340-775-8310 direct line