When Turk and J.D. are helping Mr. Foster into the MRI machine, Turk mentions J.D.'s bracelet with the phrase "Sasha forever." After the machine was "fired up", as J.D. puts it, his left hand is magnetically attracted to the machine due to the bracelet being present on his wrist. Turk's left hand is also attracted to the machine because of his watch.
In reality, the powerful magnet in an MRI machine is always on, and no personnel, doctor or otherwise would have been allowed near the machine with any ferrous metallic objects. Additionally, the magnet is in the circular part of the machine, so J.D.'s bracelet would likely not have been attracted to the outer part.