Can I convert an SPFx solution that works only on SPO to work on SP2016, 2019 and online without creating a new solution? and what are the differences between the solution the only works on SharePoint online and the solution that works on both on-premises and online?
Because SharePoint Online and SharePoint 2016 have different release cycles for new capabilities, they also have different capabilities when it comes to the SharePoint Framework. SharePoint Online always uses the latest version of the SharePoint Framework, but SharePoint 2016 only supports the version that matches the server-side dependencies of the deployed packages.
You could refer to the following articles to know the differences: