On the other hand, which is better to use Ethernet or CAN bus?
You have not mentioned the speed you
need ? but if CAN is on the short list, it does not sound that high
One more question: Can I use RJ45 Ethernet cables for the network with CAN bus devices? I find it as convenient and cheap, but I don't know if they can technically be used.
The idea would be to connect the master to one node, and from each node to the next, with the termination resistor in the latter, using RJ45 Ethernet cables.
At CAN-region speeds, and short distances, you can use almost any cable.
If you want to send power as well, 8 pins may make sense, and Ethernet cables are common. Just choose the pins for least damage should someone cross plug
If you are going to ring-wire this, you could look at a Standard Serial (UART) Ring link. A UART ring bus decides the address by the Physical place in the ring, so no address switch is needed.
Modern MCU UARTs can manage CAN speeds, and if you code the slaves and what they all do, simpler can be faster and better.
UARTs also allow ANY small MCU choice at the nodes.
Cable drivers can be RS422, RS485 or CAN or Dual CAN etc - newer CAN drivers can manage to 8MBd (eg MCP25612FD-H/SL)
One appeal of Dual drivers, is you open up other choices too
* you can run 2 links 'both ways' (CW & CCW), so a single break can be detected & even limp-home (tho a simple link watchdog can drop into a no-RX ping mode, to allow similar break report)
* you can use the second link as a trigger, for precise timing if you need that.
Using a second UART as the trigger, allows a simple trigger-type tag, and still gives interrupt-precision levels.