Yep, the advertising packets can be used for things like this. And frequently are in IoT settings. Typically by using the AD type Manufacturer Specific (0xFF). BLE 5.x makes it possible to have many more bytes of advertisement data, including longer packets and chains of packets. Otherwise the mechanisms stayed the same as in 4.x. Which is good, as BLE 4.x only hardware/software is still around...