How can I deal with hallucinations caused by dementia in grandma?

Depends on the type. Hallucinations can be from many causes including infections, tumors, medications, and of course dementia. They can be auditory(hear things that aren't there), visual(see things), tactile(feel things)or olfactory(smell things). Depending on their severity, looks like your grandma should be properly evaluated by someone who specializes in the field of geriatric psychiatry.
Reassure or Rx. Hallucinations occur in large proportion of demented patients. Unfortunately there is no cure. The best non-medical therapy is gentle reassurance. But if that doesn't work, particularly at night, medications may be the only answer. But there are risks. A trade-off between quality of life and length of life may be needed, consult grandma's physician for details.
Get her evaluated. By a geriatric psychiatrist in your area.