Mazda and Ford share engine blocks (i.e. the 3.0L in my Mazda6 is a Duratec block), however the electronics and most of the moving components are developed by the respective companies.
OBD2 codes should be the same for late 90's models. Mazda switched over to CAN last year.