You can, assuming your undergrad school finishes before med school starts. Some people have to in order to finish their degree or finish classes to honor their acceptance (because they told the school they'd be in classes, usually a prereq).
That being said, if it's possible to not, don't. Relax during that summer because med school hits like a freight train and you want to be well rested and relaxed.