Trailer docking should be easy for software to do for a straight backup to the trailer. Drop air. Backup and align hitch to trailer connection. Continue backing to the right location using sensors and cameras. Get to proper location, stop, raise air and wait for the human to finish the connections. If the Tesla can self park it is not a far leap. Now if it is in a tight space and not a straight back in then it is a different story.
My 2013 f350 has a hitch/backup camera and it was a third party add on. I couldn't tell you the brand, but it works well. I imagine it'll come standard for Tesla.