"My doctor says that I am not allowed to eat sugar."
No. 不允许 doesn't show the passive tense, so your sentence literally means "My doctor says that I don't give permission eating sugar", which doesn't make sense.
If you insist to use the word (不)允许, then you should adding 被 (passive marker), as 我的医生说我不被允许吃糖.
Although my sentence is grammarly correct, but native speakers won't say like this.