Data exchange between DMVs or for other non-law enforcement purposes is coordinated through AAMVA. You can see what states exchange data here: (https://www.aamva.org/it-systems-participation-map). There are loopholes that people exploit - for example NJ registered trucks won't be subject to registration action in NY... so you can accumulate lots of tickets in NYC with no consequence.
Some Canadian provinces exchange data between individual states as well.
A system called Nlets connects every jurisdiction for law enforcement purposes.