It's much more primitive than you think. Dose distributions are simulated based on a CT/MRI that was acquired before treatment (treatment often lasts weeks). Only minor corrections are made when anatomy changes during the course of treatment, even though the patient is often losing tons of weight due to chemo, etc. There are quite a few tools that help with patient positioning, like vac-lok bags or literally molding a mask and drilling it down on the treatment couch (an example is shown here:
https://newsnetwork.mayoclinic.org/discussion/new-radiothera...).
Motion during treatment can be tracked with cameras or IR sensors or subcutaneous probes but that doesn't tell you about internal organs moving. The topic of deformable registration, where you find a non-rigid mapping between initial imaging conditions and the current ones, is still a topic of active research. Adaptive planning, where you actively change the treatment plan every N sessions based on the most up to date information, is also actively researched / implemented in some good research centers.
For treatment planning you just use a standard Cartesian grid, or a "beam's eye view" coordinate system that's aligned with the radiation beam axis as it rotates around the patient.