Using the ST-Link firmware on non-ST hardware is most likely a violation of the license. (all those stlink dongles out there, but they're quite convinient)
But to use it, there have been ST-Link bootloaders out there for years,
also, there have been various CMSIS-DAP firmwares out there.
But that is no requirement considering MCUs from other vendors. OpenOCD will work fine with ST-Link and non-ST MCUs.
There have been few exceptions, such as Cypress PSoC4, but using the new stlink-dap implementation (requiring a recent ST-Link firmware though) even those work fine.