You would need to lock the satellite in position respective to the repair-bot/-spacecraft. The last vehicle that could do just that was the Space Shuttle with its robotic arm. It made for some very costly repair missions.
Apollo and Soyuz pulled this off prit near fitty year ago, back in the olden times (and Apollo CSM/LEM before that and Gemini/Agena before *that*). Docking a Dragon to something akin to a mass-produced lightweight Hubble does not seem all that challenging. Unless the satellite was spinning wildly out of control, rendezvous and docking would seem pretty straightforward. And if (admittedly a big IF) SpaceX pulls off their dream of launching Starships for ridiculously cheap, then docking something with a cargo bay roughly akin to the size of the Shuttles with any kind of satellite would seem almost trivial.