Can a doctor from one country prescribe medicine to a person in another country if they both are connecting through an online medium?
You don't say what exactly you mean by "can".
First, that doctor won't prescribe anything unless they are paid. Second, the prescription will most likely only be valid for pharmacies in the doctors country; often only valid for one local pharmacy, and most definitely not for pharmacies outside the country.
So you have to convince the doctor to issue a prescription, to send it to you in a foreign country, and then you have to convince your pharmacy to hand over the medication to you. Not going to happen.
Now if you think about a doctor in another country who will actually send you the medication: In that case, you have no idea whether the "doctor" is actually a doctor, and whether the "medication" he or she sends is actually what it says on the box.