When I call a person doctor If I call a person doctor, instead of Doctor XXX, will this person assumes that I forget his name?

When I talk with another person, I said:" I wish to study in doctor's lab." At that time, the doctor is just next to me.
It is not common in my experience (first-language English speaker in the US) to call anyone just "Doctor" unless they are a medical doctor. In non-medical settings, you should always use their surname after the title.

On the other hand, it is OK to use just "Professor", if you are speaking to the person.

So you could ask, "Professor, can I take the exam tomorrow?" But not "Doctor, can I take the exam tomorrow?"

If you are talking to someone else, you should always use the surname, don't just call the person "professor" or "doctor" as if that was a name.