Yes, it is straight forward. If you defined a variable for your browser just change it to the headless corresponding name. For example robot -v browser:headlesschrome ...
You only may need to adjust timings with Wait ... keywords. If you test first in local system, it should behave the same in CI/CD system.
This is in-house solution, real hardware macMini as a node of Jenkins. But use it for testing with Safari and Appium (Android and iPhone), macOS apps never tried because not needed (but would go for Sikuli as first try).