Replacing old 100 amp electric panel
Yes, that's fine - heck, it's practically mandatory.  

Manufacturers vary, but looking in the big box stores, you almost can't get a 100A panel larger than 20 space - and that's just too darned small for a house.  

We see plenty of 20 space panels totally filled with double-stuffs, a tactic no longer practical now that so many circuits need to be AFCI  or GFCI. It's plain from the panels we see that even 30 spaces are not enough and are likey to totally fill, with the person coming back here going "How can I add to this panel?"  Really I wouldn't consider less than a 42 space unless the situation was very special. Maybe even dual 30‘s depending on layout (mich cheaper than a 60-space).  

The problem is all of those large-enough panels will tend to come with 150, 200 or 225 amp breakers. You have to swap in a 100A to get a useful panel. 

Or alternately, get a 100A breaker in the upper left spaces, and backfeed it and just don't use the main..... but you'd want very good coverup and labeling to steer your panicked girlfriend or fireman working by flashlight to the correct main.