There is evidence that being well rested vs sleep deprived has effects on your immune system (which makes sense - if you are sleep deprived you are more susceptible to infection due to temporary immune supression)
But there is also evidence that being well rested can improve your body's response to vaccine
Sleep enhances the human antibody response to hepatitis A vaccination
https://pubmed.ncbi.nlm.nih.gov/14508028/
I'll defer to the smarter and very helpful immunology folks in here for their ideas on this. But there isn't any harm to being well rested in advance and just after you get your shots (and lay off the heavy drinking in celebration of getting the shot - at least for a couple days)