Not at runtime, only when starting the application.
Constant definitions (name and default value) are always configured in the modeler. However, you can (and should!) provide different values depending on which environment you're running.
In the standard cloud you can configure them from the portal. Assuming you're using m2ee-tools, you can configure them under Linux using m2ee.yaml
For Windows, there's a service console that allows you to edit these values, under the "application constants" tab.
At least in Mendix 9 (maybe earlier) you can call the semi-documented method to update the constants:
// BEGIN USER CODE
final Configuration conf = Core.getConfiguration();
final Map<String, Object> map = new HashMap<>();
final Map<String, Object> map2 = new HashMap<>();
map.put("MicroflowConstants", map2);
map2.put(name, value);
conf.updateConfiguration(map, true);
if (!Objects.equal(value, conf.getConstantValue(name))) {
throw new CoreException("Constant value was not updated");
}
return null;