Yes, you can store extra frosting in a piping bag overnight. However, if it’s American buttercream it can begin to dry out so I don’t recommend it as it won’t be exactly the same as making it fresh. If it’s something like donut batter you can skip cutting the hole to prevent it from drying out, pop it in the fridge overnight and it’s no issue. Cut the hole when you’re ready to pipe it out the following day.