Yes and No. In Transformers: The Movie, Megatron is severely damaged after his fight with Optimus Prime, and is thrown into space by Starscream. In exchange for helping him destroy the Matrix of Leadership, Unicron repairs his damaged body and turns him into Galvatron.
However, even though his body is forged from Megatron's, and his memories are still intact, he is largely changed after his transformation. His personality is drastically different, and the other Decepticons treat him as if he is another person entirely.