Praise be to Allah.
If you are a doctor working on your own account (i.e., in a clinic of your own), then it is permissible for you to accept the invitations of these companies, on condition that you do not let that influence the kind of medicine you give to the sick. Rather you should prescribe the best medicine for the patient, paying attention to the price, or you should give him the freedom to choose. On this basis, your acceptance of the invitations extended by these companies should be to enable you to find out what kind of medicines etc. they have to offer. By the same token, if you are not working for yourself, if you accept these invitations simply to acquaint yourself with the company’s products, that is o.k., but if that will make you biased towards one company rather than another because of these invitations or because of gifts that they have given to you, then that is not right. If you are not working in your own clinic, and you have influence in the hospital where you work such that they will buy the kind of medicine that you advise them to buy, then it is better to avoid these invitations in order to be on the safe side.