Every baptism requires the consent of the individual or, in the case of minors, the consent of his/her parents or legal guardian.
The consent may not be explicit, but must be clear enough that he/she desires baptism.
For example, if a man has informed the family he wanted to be baptized like his deceased wife some years ago, and he has never contradicted this statement subsequently. If he suddenly lost his faculty, this previous expressed wish would be sufficient consent to allow for baptism.
Or, sometimes long after the patient lost his consciousness, he would still be able to faintly respond to verbal stimuli. Many times I was able to get some simple responses from them. So if they could clearly respond to the affirmative when asked if they want to be baptized, then baptism is possible.
Of course, if there were no previous mention, and the person is not able to make any responses, we are not able to administer baptism.
(Editor note: related question- Can a non catholic baptize a dying person if the dying person expresses a wish to become catholic?)