My daughter was insistent on taking a drink to bed for a long time, probably from a similar age until she was about 4. Unfortunately, once we'd finally decided to intervene (I think a few months before she turned 3), it was way too late and had reached the stage where it was a pretty fixed routine for her; breaking it was very difficult. Our refusal of a drink at bed time made her refuse to sleep (crying, leaving bedroom, secretly playing with toys, etc). Sneaking the drink out after she was asleep would result in being woken up at various unpleasant times in the morning because she couldn't find her cup (this would also happen when she had the cup and it fell on the floor, down the side of the bed, etc, but with lower frequency). Giving her a smaller quantity of drink resulted in arguments at bedtime (because she didn't want a "small" drink) or again with midnight wake-ups because the cup was empty. Pretending to run out of water didn't work. "Losing" the cup didn't work. And so on...
In the end it was a phase that (eventually) faded away on its own, although it still feels like it took a very long time to get there; I suspect most of our efforts to combat it were fruitless, if not counter-productive.
We did experience problems with toilet training, and I think that this was a major factor, because she was consistently wet during the night for a long time. It took her longer to be effectively toilet trained than the vast majority of her peers at nursery, and she continued to have accidents for a much longer period as well. Even as we made progress during the day, she had to keep nappies on during the night (because she would fill them, or without them would soak the bed), which I'm sure impeded her daytime success.
So, based on our generally negative experiences, my advice in response to your headline question is:
Yes, at least gently discourage this behaviour to prevent it from becoming part of their expected routine.
However, do note that my daughter is now almost 5, and at school, and we have no continuing toilet-related problems, so thankfully there doesn't seem to have been a long-term detrimental effect.