Upvote:1
There are no issues for you in Dubai; because you will not pass customs or immigration while in transit.
There are no exit controls in the US.
However, when you arrive at your final destination - you may need to show a prescription and the drugs (ideally, they should be in their commercial packaging) to customs.
As long as the drugs are of a reasonable quantity for the time you will be there, and are not restricted (sometimes, drugs that are perfectly legal in one country, may be illegal in others - this is especially true with painkillers and other drugs that contain narcotics) and you have a prescription, you will not face any issues.