Required crystal frequency for MCP2515 with ATmega328P
The clock frequency must be picked so that it suits the divisor hardware of the CAN controller. What's suitable is different from controller to controller, but often the clock depends on how many time quanta you use per baud rate. You should aim to use one of the CANopen standardized baud rates and sample points, since these are industry standard (like 250 kbps or 125 kbps). The standard is available for free somewhere at https://www.can-cia.org if you register and download.

When you have determined how many time quanta that's needed to achieve a certain baud rate, you should pick a clock that gives a divisor error of less than 1%. CAN is picky with this: inaccurate divisors may cause the whole node to fail. Therefore you must always use crystal oscillators for CAN communication; built-in RC oscillators are too bad to be used.