yes and no
All transformers were created from the all spark. So in essence they are all siblings...
In the original G1 cartoon, no. Megatron had become leader of the Deceptions long before Optimus Prime became leader of the Autobots.
In the media regarding the current movie franchise, yes. Optimus Prime and Megatron were both co-leaders of Cybertron and were considered brothers.