Model-based RL with Optimistic Posterior Sampling: Structural Conditions and Sample Complexity