Is X software secure is not a simple yes/no question. Windows 10 itself releases security patches all the time. So is it secure? Every piece of software needs to constantly improve fixing security problems as they come up.
Moodle is constantly being worked on with security in mind. We put measures in place to guard against misuse and prevent security holes.
To ensure your moodle is set up to be as secure as possible, you can read https://docs.moodle.org/33/en/Security_recommendations