First, to make sure the terminology isn't confusing: baudrate means data items per second and bitrate means bits per second. In case of CAN, baudrate = bitrate.
Start here: What are the most common causes of CAN bus communication errors? Regarding clocks specifically, we can learn the following from that post:
The baudrate also needs to be fairly accurate - the standard (CAN 2.0B chp 9) mandates at least 1.58% clock accuracy from each node. I'd personally recommend to keep it below 1%. Some rule of thumb from the standard is that when you need speeds of 250kbps or faster you should avoid RC oscillators/ceramic resonators and use quartz. If you are using a MCU with built-in RC oscillator, check the specified accuracy.
Furthermore, the CAN controller setting of the various time quanta that each bit consists of, needs to be configured so that the sample point of each bit is as close to the recommended 87.5% of the bit length as possible (CANopen DS301 chp 7.2). Ideally done by having 16 tq total, 14 before the sample point and 2 after it. This too is a consideration that needs to be done by the programmer when picking the clock source for the MCU - otherwise it might be impossible to support all standardized baudrates with sufficient accuracy. Getting this right is not trivial and usually the most complicated part when writing a CAN driver.
Both the sample point and the baudrates are standardized mostly through CANopen (and then everyone follows that regardless of whether they use CANopen or not). From the CANopen CiA 301 standard (source CAN In Automation - the standard is free to download if you just register):
Ideally you need to support all of these (and sometimes 100kbps), but the most commonly used are 125kbps to 1Mbps.
As mentioned in the quote from the post above, the easiest way to achieve the specified baudrate with correct bit sample point is usually to have 16tq, time quanta. One time quanta corresponds to the clock speed of the CAN controller. The various segments of a bit is specified by the CAN standard itself is sync segment, propagation segment, phase segment 1 and phase segment 2 (see this for examples). You need to tell the CAN controller how long each segment should be and that's also what gives you the baudrate.
The sample point location is given by the length in tq of everything before phase seg 2, divided by total tq. For example a common setup is sync seg=1tq, propagation seg=11tq, phase seg1=2tq, phase seg2=2tq = 16tq total. (1+11+2)/16 = 87.5%, which means ideal placement of the sample point.
This is where the clock prescalers of the MCU come in. Lets say you have a system clock of 8MHz and you wish to use 16tq per bit and bitrate 250kbps. The universal physics formula for anything-baudrate is frequency = 1/time.
You then need to run the CAN controller with clock/16 = 250kHz (or if you will, 1/clock * 16 = 1/bitrate), which gives 4MHz. The system clock of 8MHz therefore needs to be divided by 2.
The above is fairly universal for all CAN controllers. I've written CAN drivers for a lot of different controllers and how to set clock settings is most of the time similar. The most tricky part is always configuring the sample point.