Is it safe to use a cpap machine without consulting a doctor?

No. Why do you want to use the machine. This is not an item for self diagnosis or self treatment. Please consult your doctor.
Safe? Safe? Probably. But you won't know how to optimize use of the machine without expert input. Work with a sleep doc.