Pinned boats are not that uncommon on small streams. There are many ways boats get pinned like undercut rocks, strainers, boats without flotation, cracks, etc. In the old days when I started, cockpits were quite small and leg entrapment was a significant safety concern. These days, we have huge cockpits and leg entrapment is far less common. Many boats have extra easy to reach attachment points called pin bars - something I always look for in a decent creek boat. Over time, you will learn how to recognize dangerous river features and develop the necessary skills to avoid them. When unpinning a boat, raft, or canoe - you usually have plenty of time. Try using the simplest and safest techniques first.
Anyone that has been paddling a long time has seen several boat pins. In the old days, this was much more scary. Back then, boats had rather tiny cockpit openings which were really difficult to escape. In England, they required all fiberglass boat makers not to have any cloth, just resin, around the cockpit. This made it easy to smash the deck with your fist for an easier getaway. Boats were roughly twice as long back then as well and many had pointy ends, perfect for getting caught on obstructions. All boats back then required ethafoam pillars to keep the decks from collapsing. We had to install and glue these ourselves. A heads down pin can be really scary for both the victim and your fellow boaters. Since they can't breathe, rescuers often sacrifice their own safety to reach the victim before they drown. Pins are one place where defense reigns king - do whatever you can to avoid them. Here is some video footage of someone getting pinned in their kayak: Kayak Pin.