If the patient is on a ventilation machine, can the hospital pull the plug without the family/friends consent?

Depends. If the patient has given an "advanced directive" the hosptial and physicians are obligated to adhere to the patients wishes even if this is against the wishes of the family or friends.
Depends. If the patient's wishes were to have it removed such as in a living will, their wishes must be followed regardless of others wishes. A medical power of attorney can make decisions on the patient's behalf. If multiple doctors agree that care is futile and death inevitable, the ventilator can be removed. Open discussion is a must so that understanding can be achieved.