Primers can back out if the headspace is excessive. When you see primers that look like they are melted, it is generally a case of the primer backing out, starting to expand radially, and then the case catching up and smashing it flat against the breechface.
Don't forget that some designs were actually built around the concept of using the rearward movement of the primer to actuate the bolt.