I'm one of the developers on both projects.
It is pretty much always safe to use Webmin and the command line on the same configuration files. We're system administrators ourselves, and it would infuriate me to not be able to hit the command line. As long as the service itself (Apache, Postfix, whatever) can read and parse the file, Webmin should be able to, as well. And it will never overwrite your changes...next time you visit the service in Webmin, you'll see the new configuration. Webmin always works directly on the files and there is no intermediate step or database.
Virtualmin has a small amount of its own meta-data, and it would be possible to break stuff in a Virtualmin system, while not actually breaking the configuration for the services it manages...but it's pretty rare. Virtualmin is also designed to allow configuration via the command line. You generally don't even have to think about the spots where it might cause trouble, because they're things you, as a reasonably knowledgeable sysadmin, wouldn't do. Like messing with GID/UID of users, which would break associations between domains and users. One other area to be aware of: If you change passwords outside of Virtualmin using passwd or something else, it will not be able to update all of the other related passwords to match (which may or may not be a big deal; just depends on your use case and your users). There is a command line tool for Virtualmin that allows command line changes to anything in Virtualmin, including password, as well...so you can still script things that wouldn't be safe to change outside of Virtualmin using that command line tool, or the HTTP API.
So, in short, if being able to edit configuration files is important, I think Webmin and Virtualmin are probably the best options available. At least, I don't know of any other full-featured control panel that does this. It is pretty hard to do, so most projects and products punt and rewrite files from templates and such.