Could you have a sudden shoulder dislocation that immediately pops back in?

Dislocation. Yes this condition can happen. The term for this is a subluxation. If it continues you need an evaluation by an orthopedic surgeon.
Yes. This is termed a subluxation or a dislocation with spontaneous reduction. These usually happen in patients with multidirectional instability, but can happen in other types of shoulder instability.