I am a bit confused regarding the baud rate of serial communication.
Your confusion appears to be about the basic clock synchronisation, not the baud rate.
so it takes the data a bit ahead from the edge
Your thinking is along the right lines: how do we make sure the receiver isn't sampling near the edge of the bit time. But your suggestion about how to do this:
If we have the baud rate of the receiver a bit different
... that won't work in the way you're imagining. We don't want different rates, we want the reciever to estimate where the sender's bit times begin. To sample reliably, we can sample in the middle of where the receiver thinks the bit will be.
The correct way uses the falling edge of the start bit to achieve this synchronisation.


The green part ensures we're in idle or a stop bit; the blue part finds the falling edge (we want to do this quickly, perhaps 16 times as fast as the bit rate), and the red part estimates the middle of the bit time, followed by getting the bits.
All the sophistication lies in either a) Finding that falling edge accurately, b) multiple sampling in order to discount spurious spikes, or c) dealing with any errors.
It's not common, but you can make systems which measure the bit rate from the signal. More common is to detect which of the common speeds is in use by trying different them and looking for recognisable patterns such as ASCII CR values. But without a doubt the most common case is simply to have both sides configured to use the same speed.