Bluz DK has three layers of firmware. The first is the closed-source SoftDevice from Nordic, this is the BLE stack. The second is the system firmware stack, this is our firmware that allows bluz to talk to the Particle cloud. It is written with the Nordic SDK to talk to the SoftDevice and tell it what to do. The third is the user code, whatever the user programs bluz to do, that sits on top of both.
To implement mesh with bluz, you would have to merge it into the system firmware stack. If you weren’t using bluz, you could just use whatever is provided. But to make it work with bluz would be much more complicated as you would need to merge their logic for the BLE layer with ours.
At the end of the day, you can use bluz hardware as any other nrf51822 device, you can replace our firmware with whatever you would like. So you could use bluz as the hardware, but use any Nordic firmware that you would want.
You can only flash bluz Over the Air with our system firmware and bootloder. So if you replaced the bluz firmware stack with the OpenMesh one, you would no longer be able to flash OTA via Particle. THe nrf51822 can still be flashed OTA, Nordic provides examples of this, but I don’t know i that is supported with OpenMesh.
To debug, you would need a JTAG programmer. The Segger JLink is probably the best one for debugging and flashing firmware.