Car headrests were deliberately designed to be removed so that they can be used to smash windows during emergencies.
In April 2016, a message circulated on Facebook affirming that car seat headrests were deliberately designed to be detachable and sturdy so that they could be used to break car windows in emergencies:
This “survival tip” has been around for several years and has been featured in a number of survival blogs, but it gained widespread popularity in 2012 when it was featured on a Japanese game show:
While it is possible to break a car window with a removable headrest, this is an incidental application of that object rather than a deliberate one. The primary intended function of the modern car headrest was to prevent whiplash in case of accident: When Benjamin Katz filed a patent for an automobile headrest in 1921, he noted that the device could stabilize the head when it was subjected to the “jolts and irregular movements” inherent in driving an automobile. The car headrest has since gone through many changes, but these primarily focus on safety, comfort, and manufacturing, not emergency uses.
Regulations from the National Highway Traffic Safety Administration regarding head restraints also focus on reducing or preventing whiplash, not breaking windows. A NHTSA and Department of Transportation ruling in 2004 revisited the standards, specifically addressing “Maximum Gap Allowance and Removability“:
Nissan asserted that there are potential production difficulties arising from front head restraint non-removability. Installing a large seat fitted with a head restraint into a small vehicle, Nissan asserted, might be an arduous task.
Honda wanted all restraints to be removable by hand, out of concern that non-removable head restraints would limit seat design flexibility. Honda believed that a non-removability prohibition would prevent it from offering the “fully flat seat” option in its CRV model vehicle. 
DaimlerChrysler concurred with making front seat head restraints more difficult to remove than rear seat restraints because of their safety benefits and the absence of a need to remove them for visibility and functionality reasons. DaimlerChrysler also agreed that there should be some means to remove front head restraints for purposes such as seat cover installation. However, DaimlerChrysler wanted the word “tool” to be interpreted as including the mechanism in their current vehicles requiring two hands to operate.
A majority of industry commenters wanted NHTSA to allow removability of rear head restraints in the final rule. Ford believed that removability of rear head restraints would allow occupants to fold seats to increase space and would reduce possible incompatibility with child restraints. Ford stated that while many vehicles are currently designed with head restraints that are removable by hand, Ford does not know of any data regarding misuse or improper adjustment of head restraints caused by hand removability. DaimlerChrysler believed that NHTSA should permit rear seat head restraint removability to facilitate increased vehicle utility and rearward visibility.
Agency response to comments on head restraint removability: After considering comments, NHTSA decided to allow removability of head restraints solely by hand. However, for both front and rear optional head restraints, removal must be by means of a deliberate action that is distinct from any act necessary for adjustment. That is, the “action” required for removal must be distinct from that required for adjustment. For example, the head restraint may be removed by depressing a special button or operating a lever located somewhere on the head restraint or the seat back. However, the action involved in adjusting head restraints must be different. This insures that head restraints are not accidentally removed when being adjusted. The new removability requirement uses language very similar to that in ECE 17, Paragraph 5.13.
We are establishing the new head restraint requirements to ensure that vehicle occupants receive better protection from whiplash and related injuries. To achieve this purpose, the agency wants to take reasonable steps to increase the likelihood that a head restraint is available when needed. If head restraints were too easily removable, chances are greater that they will be removed. That, in turn, increases the chances that the restraints might not be reinstalled correctly, if at all. By prohibiting removability without the use of deliberate action distinct from any act necessary for adjustment, the likelihood of inadvertent head restraint removal will be reduced, thus increasing the chances that vehicle occupants will receive the benefits of properly positioned head restraints.
The ability to break windows in case of emergency was not mentioned anywhere in this discussion, and the major industry concerns appeared to be visibility and whiplash prevention.
Federal Motor Vehicle Safety Standard 202 does not require automakers to manufacture head restraints specifically so that they can be used to break windows in emergencies. While some can potentially be used that way, they are not designed with that specific purpose in mind.