Theoretically no, because a chemical is a chemical and it is supposed to work regardless of the attitude of the person taking the medicine.
BUT -> I have a read a lot of research (in scientific journals such as Journal of Pastoral Care, and others) that has done work on the recuperative effect of prayer in sick patients. (I can find the other journal titles if needed.
The research shows that in some (not all) cases, there is some sort of effect that assists the patron’s recover. Is it prayer? Is it that the patient’s comfort in prayer helps the body create some chemical that interacts with medicine? No one knows. But there appears to be some effect.
So if we take prayer as an example, I guess it is at least theoretically possible that a bad attitude towards medication could cause some chemical change in the body that would negate the effect of the medicine.
But this would need a TON of serious medical research to prove.