Yes, it does happen to dogs a lot. Many years ago, when I was young and naive, this happened with my Golden Retriever. A neighbor's female dog got out, and they were having great sport in the back yard. The neighbor and I were frantic, as we saw the 2 dogs were stuck.
I called my husband (who grew up on a ranch) and said "What should I do??" He replied, "Stay calm, and listen carefully. I want you to walk very slowly, and quietly into the kitchen, and open the drawer by the phone."
"And then what?" I yelled.
"Get the camera."
Yes, this happens to dogs in the natural course of things. It's called "the tie" and it can last up to an hour. But for them it's normal.