From what I understand so far, you've done a degree in something that's not physics. You're qualified to get into a master's program in data science or machine learning and want to enroll, but are interested in doing work in physics or geoscience areas, and want to know if you can pick up enough physics on the side to break into the field, and potentially enroll in a PhD.
Getting into a PhD in physics (or medical physics) generally requires a bachelor's degree in physics, or it's equivalent. This isn't the level of knowledge that can be typically picked up on the side, while studying something else. And in most MSc programs, you'll be pretty busy studying the MSc material. Most MSc programs don't allow you to pick up a minor anyway. Some medical physics programs are little more flexible in terms of the background of people they'll accept. So you could potentially look into doing a master's in medical physics that involves a machine learning project, but again, without a bachelor's degree in physics or something very close to it, this will be an uphill battle.
Getting hired to do machine learning work in one of these fields though, can depend a lot more on your experience in the area. If you were to get an MSc in machine learning and apply for a research support position on a project that's looking at say, using machine learning algorithm to reduce noise in CT image reconstruction, whether or not you get hired will probably depend a lot more on your ability to work with the specific algorithms and data sets that the research group needs you to work with than your general background medical physics.