"Bom dia, doutor!"
Translation:Good morning, doctor!
Yes, it can mean a medical doctor or someone with a Phd from University. http://dictionary.reverso.net/english-portuguese/doctor
"Médico/a is a doctor of medicine. Anyone with a PhD can also be a doctor (doutor/ra) such as a Doctor of Philosophy = *Doutor de Filosofia" (where the PhD abbreviation derives).
A doctorate degree is the one above a master's degree which is above a bachelor's (or baccalaureate) degree which is above an associate degree.
So, someone can be a "doctor" (even using it in their name as Dr. as an honorific in place of Mr/Ms, but not all are medical doctors.
Other honorifics (and doctorate degrees) usually placed at the end of names to eliminate ambiguity are MD (Medical Doctor), DC (Chiropractor), ND (Naturopathic Doctor), OD (Optometrist) JD (Doctor of Law), EdD (Doctor of Education), DTh (Doctor of Theology) and so on:
However, in Portugal at least (not sure about Brazil but I think so too), it only requires a Masters Degree to get the "Doutar" ("Dr.") title.