Of course it is possible. There was a case on TV a few years back about a cat that saved her owners life doing just such a thing.
There are assisstance dogs who are trained to detect just before an epileptic goes into seizure and similarly prior to panic attacks for those people. There are so many cases of dogs doing this sort of thing I am surprised you even question it.
This comment was approved by the NACBLOG editorial board. Please remember to add your name and affiliation!