Nordic softdevice provides APIS regarding BLE and MAC address on nRF51 and 52. (function calls may be slightly different depending on the softdevice version).
1. Get BLE MAC Address
2. Change MAC Address
There are two ways; one is randomised mac, another is change as given address.
3. How to check factory BLE address and H/W Serial No. using Segger and nrfjprog(nRFgo Studio)
MAC Address
H/W Serial No.
ref :
https://devzone.nordicsemi.com/question/49876/switching-between-random-and-normal-mac-address/
https://devzone.nordicsemi.com/question/43047/sd_ble_gap_address_set-works-for-normal-mode-only/