Yes, a patient may refuse treatment if he has an uncured disease, with clinical signs that he is already in the terminal phase of it. As long as you are aware, the patient may register his or her wish in a notary's office or appoint a representative to make such a decision and the physician must abide by such a decision.
What must prevail is the patient's desire and the doctor has an obligation to respect it, even if the family has a contrary opinion. However, it must be stressed that for this to happen, it must be a special condition, in which there is no cure for the disease.
In such cases, both physician and patient may opt for palliative treatments, such as pain relieving medicines, so that the end of the patient's life is quiet and dignified.