On your first opportunity to see the Pompeii sight, if the weather is good, see it, and then the museum. If it is raining or there is other unpleasant weather, but if the weather is supposed to be better the next day, see the museum first.
I saw the Pompeii sight the day before I saw the museum. In general, I prefer to learn some background information before seeing major sights. Before my trip, I read a big coffee-table sized book containing half color illustrations, and small print, that was mainly about Pompeii, and a little bit about Herculaneum and possibly another nearby sight. In general when everything else is equal I go to outdoor sights before museums. If you don't have advance tickets, make your decision at the last minute based on the weather.