I want to do CAN bus communication between 2 ESP32

have a look at using-two-esp32-boards-and-2-mcp2515-boards-to-communicate-over-can-not-receiving-anything
you can use a pair of MCP2515 modules or TWAI interface driving cjmcu-1051 (or similar) transceivers