It Doesn't Make Sense
To scientists, it doesn't make sense, but some dogs, both trained in human assistance and just companion animals, have shown the ability to sense epileptic seizures before they happen. Typically, this manifests itself as whining, nudging, and other attention that the dog focuses on the person, who may have no idea at all, that a seizure is imminent. In many such reported cases, the dog has stayed with the patient during the seizure, offers comfort afterwards, and even helps them to get up, and/or oriented following the event.
Whether dogs can actually be trained to do this, remains a subject of much debate. The ability of dogs to sense their owners' needs, is something that is cited by the Delta Society, which promotes the benefits of animal companionship.
Trainers and scientists have observed that the dogs who are most responsive to imminent seizures, are those with the closest bonds to their human owners. While it is theorized that all dogs likely have the ability to sense seizures, only a very small percentage have the innate ability to respond appropriately and "assist" the patient, or go for help.
Research suggests that changes in the body may give off a chemical odor detectable only by the super sensitive nose of canines, and it's that which signals the oncoming seizure, but it does not explain why some dogs will come running from other rooms, to alert their owners.