As long as the babies or toddlers diaper is not soaking wet and they don't leak out of the diaper at night then yes you can leave the baby in the same diaper all night.
It's perfectly fine to go all night without changing diapers as long as it's not bothering the baby.
However with cloth diapers you may need to change those diapers when wet in the middle of the night because the baby or toddler can feel the wetness.
But with the disposable diapers they absorb the pee and hold it away from the skin so the baby or toddler does not feel wet.
I have left my kids in a wet diaper at night and then changed them in the morning.
Just put some diaper rash cream on their bottom and around their private areas and if it's a boy coat the boys penis and balls with some diaper rash cream to keep the urine from causing a rash.