Historically, it was the choice of the manufacturer, or it required the services of a gunsmith to change the firearm, typically. However, the trend for the past couple of decades, at least, has been for manufacturers to build firearms that are modular in nature, and that are designed for the end-user to change the features to transform the firearm from one purpose to another.
On December 8th, 2022. See this statement in context.