It's complicated.
OBD and OBD2 is both a connector standard (the two-row connector, about 1.5 x 3cm, with about 20 pins), and a protocol standard. Some of the pins in the OBD connector are CAN bus protocol, with the standard IEEE-something electrical signaling. But the CAN bus that's visible on the OBD connector is not necessarily the vehicle's main internal bus, but just talks to an interface unit which the relays data to/from the ECU and other control units. Most vehicles today have multiple internal buses, and multiple control units.
The ELM327 is the industry-standard (and often cloned) adapter circuit to go from OBD connector to a serial port. Most cheap consumer grade ELM327 today use a USB connector, and on the USB they emulate a serial adapter. We also have a Bluetooth ELM327 clone (I think it was $12 on Amazon), which both sort of works (you can read engine error codes when the vehicle is parked), and utterly does not work (if you leave it in while driving, it destroys all communication between the engine and the transmission, with amusing effects). Different car brands react differently to being confused by a cheap OBD; the Subaru in particular is bizarre. The whole market of consumer-grade cheap OBD accessories is a nightmare of crap; amazingly, some of the cheap crap works great though (we have 3 or 4 "Harbor Freight" brand OBD readers, and they work well enough to retrieve engine error codes).
Bigger trucks and diesels have some larger connectors, which are round and about 3cm diameter; they use Deutsch connector hardware and are bright green, but the protocols and electrical standards are very closely related to OBD, so much so that you can get a lot of work done with just a wiring adapter. I think the diesel connector is called J1939. I have a few of them, and the OBD adapter cables for them, although most consumer-grade code readers can't do much useful with the diesel protocols.
Today, even standalone diesel engines (used for example in industrial machinery) have an ECU (engine control unit), a digital control panel connected via CAN bus, and J1939 connectors. For example, at home we have a 200HP 6.8L Deere diesel engine, and I've plugged an OBD adapter in there and looked at the rpm and horsepower. Even relatively old vehicles have an amazing complexity of control units; our 2005 crane truck has an ECU (for the engine), BCU (for the body, things like lights and windscreen wipers), an ESC (Electronic System Controller, no idea what it does), and a ResCM (for controlling the engine speed and cruise control remotely). We have an error code from the anti-lock brakes (ABS), but I have never been able to find a control unit for the ABS, and no way to talk to the ABS via any protocol I can get to. So I survive with a yellow light in the dashboard, and never knowing whether I can stop (fortunately, the brakes are completely fail safe and driven by air, so I can always stop by pulling the master valve).
Our son (who is our home's mechanic) jokes that the big CAT (Caterpillar) tractor is just a supercomputer with 4 wheels. Interestingly, we've never had an problem with software or controller failures on it, but lots and lots of real hardware problems, such as burst hydraulic hoses, contact problems (right now the forward/reverse lever is not working, it got rained on and the rubber seals on the switches were ruined), diesel pumps getting clogged with water and dirt. Sometimes the whole tractor will shut down and play dead, and the fix is to wiggle the control panel around where the ignition key goes in. No wonder on a machine that weight 18,000 pounds, goes up and down mountains, carries tons of dirt, works in permanent clouds of dust in the summer, gets rained on in the winter when we forget to put it in the barn, and regularly runs into trees (intentionally, with a running start). Even though nearly everything on it is controlled electronically and computerized, that part just works perfectly.
Finally: You can buy CAN bus hats for Raspberry Pi, and also get adapter cables to go to OBD and J1939 connectors from there. Lots of Linux freeware available to play with. If I had more spare time, I would put some time into building some useful display/control boxes for our equipment at home using that hardware.