I have medical insurance and it is not covering some medicines, my question is:
Is it ok that doctor writes those medicines which are covered by my insurance and the pharmacy changes it and gives me those medicines which I need. Is there any sin for the doctor if he does so on my request.

Not allowed. Lying is not allowed.
You have to respect the agreement between you and the insurance company.
Assume that you are the insurance company, do you accept that your client do this?