While scientists do not yet understand the trigger that dogs recognize to know a seizure is coming, they do know that the foundation of response training is simple: reward a behavior the dog does (pawing, grabbing sleeve, getting agitated in any way, barking, licking, etc) while the owner is having a seizure. This is called a conditioned response. A dog trained this way is called a seizure response dog, one that responds to the seizure as it is happening.
A seizure alert dog is able to predict that the seizure is coming. Some dogs appear to have this as an innate ability while others can develop it. This is not something that can be trained so far as we know today. What may happen over time is the seizure response dog learns to look for smaller and smaller clues (whatever they are) to predict the seizure will happen so they can get rewarded sooner (an example is a dog that is fed on a regular schedule that starts 'asking' for supper earlier and earlier.) Some dogs can predict seizures up to 45 minutes in advance.
(Source: European Journal of Epilepsy Seizure Brown, Steven W, Dr. & Val Strong 1999)
BC Epilepsy Society defines the difference between the two dogs:
Of course, training a seizure response dog is more complicated than simple behavior conditioning. In order to be a valid service dog in any jusidiction, the dog also needs to have all the foundation behaviors, such as basic obedience behaviors, being calm in public, ignoring distractions like food, kids, other dogs, cats, and people, plus it is recommended to have at least 3 specially-trained behaviors such as responding to the seizure by providing comfort, getting help, pressing an emergency alarm, dragging harmful objects away from the person as they are having a seizure, carrying information about the handler's medical condition, rolling them over to prevent airway blockages, blocking the person from falling down stairs, helping to re-orient the person as they come out of their seizure, helping the person to stand after a seizure (called bracing), guiding their disoriented person to a predetermined location for help, or reminding their person to take their medication regularly.
Not all dogs seem to be able to predict seizures. Some studies suggest only 10-15% of dogs can alert to seizures before they occur. Success may depend on the type of seizures the owner is having. Psychological seizures are induced by stress and epileptic seizures cause a change in the chemistry in the brain. For some seizure suffers, having an alert dog can lead to less frequent seizures. Further research still needs to be done in all these areas.
Even if a service dog does not learn to alert to a seizures, their handler can still benefit from the dog as s/he can stay with the person and comfort them as they recover (by laying beside them), lick them as they re-orient, or go get help as the seizure is happening (or the other tasks listed above). Of course, seizure response dogs offer constant emotional support as well.
Is it possible to train your own seizure response dog? Yes, if you have frequent seizures (I.e. your seizures are not being well-controlled by medication, some studies suggest once a month or more) and you have help from a person who can reward the dog while you are having a seizure (or you have regular access to a person who has seizures frequently.)