I know QGIS has a plugin that export DEM to STL using DEMto3D, and I tested on a DEM and it worked. The description of the plugin mentioned that clearly:
DEMto3D is the first tool that links GIS (Geographic Information
System) and 3D printing. DEMto3D allows export DEM to STL format ready
to 3D printing.
Here is the homepage of the demto3d, and there is video demonstrating the plugin, but it is not in English. However, you can still use the plugin to export the DEM to STL.
To demonstrate how DEMto3D plugin works, I used a sample of ASTER GDEM, as you can see below:
You can set the extent of the STL model to be exactly same as the extent of the DEM automatically, or you can choose a subset of the DEM, so I will leave this to you.
The most important part is the model size, you need to be careful about that to make a balance between the computer efficiency and the details of the model, so you need to do the necessary calculations in the model resolution (spacing in mm), the model area (width and length) in the setup, and the scale. However, it is not difficult because when you change the scale, for example, the Model area will be updated.
I used an exaggeration factor of 5, but you can choose whatever you like. Then you need to set the base height of the model, I consider it 0.
Here is the output STL file loaded using MashLab software:
(1) Top View:
(2) Oblique 3D View:
Changing projection from geographic to UTM, for example, didn't give different result. Here is the settings and result of the same DEM in UTM projection: