Short Answer - We don't know exactly
It would be sensible for an Escape Pod to be automated and programmed to establish the nearest population center (which could be one that contains a spaceport, or some other criteria if no such spaceport exists on the nearest planet from where the Escape Pod is launched.)
Again this is an unknown, or is not covered in any of the material that I can find. Of course as we are dealing with a movie and Star Wars sense may/may not be relevant :).
There are a couple of points that I've thought about while discussing over the comments, so I thought I would write them out.
I've found a copy of the screenplay for Star Wars here. The relevant section of the screenplay doesn't really give us any great information.
INT. REBEL BLOCKADE RUNNER - SUBHALLWAY
Artoo stops before the small hatch of an emergency lifepod. He snaps the seal on the main latch and a red warning light begins to flash. The stubby astro-robot works his way into the cramped four-man pod.
THREEPIO Hey, you're not permitted in there. It's restricted. You'll be deactivated for sure..
Artoo beeps something to him.
THREEPIO (CONT’D) Don't call me a mindless philosopher, you overweight glob of grease! Now come out before somebody sees you.
Artoo whistles something at his reluctant friend regarding the mission he is about to perform.
THREEPIO (CONT’D) Secret mission? What plans? What are you talking about? I'm not getting in there!
Artoo isn't happy with Threepio's stubbornness, and he beeps and twangs angrily.
A new explosion, this time very close, sends dust and debris through the narrow subhallway. Flames lick at Threepio and, after a flurry of electronic swearing from Artoo, the lanky robot jumps into the lifepod.
THREEPIO (CONT’D) I'm going to regret this.
INT. IMPERIAL STARDESTROYER
On the main viewscreen, the lifepod carrying the two terrified robots speeds away from the stricken Rebel spacecraft.
CHIEF PILOT There goes another one.
CAPTAIN Hold your fire. There are no life forms. It must have been short- circuited.
Artoo and Threepio look out at the receding Imperial starship. Stars circle as the pod rotates through the galaxy.
THREEPIO That's funny, the damage doesn't look as bad from out here.
Artoo beeps an assuring response.
THREEPIO (CONT’D) Are you sure this things safe?
At this point the screenplay switches to a discarded scene where Luke wakes up Biggs to watch the ship battle. The information here confirms that droids are not generally allowed on escape pods, but doesn't hint that any programming of the pod to aim for a specific destination has been made.
The link that @Valorum found for the Escape Pod specifications is also informative but not fully indicative one way or the other.
Automatic Pilot: Although most Escape Pods are equipped with a simple piloting station, the shipboard systems are heavily automated, enabling the pod to find and travel to the nearest habitable planet without a pilot at the controls.
To my mind, this would suggest that Escape Pods are automated because:
There may be no pilot included in the escapees, or the pilot on board
could be incapacitated.
Escape Pods are not designed for long term use or manoeuvrability,
simply to get to a place of "safety" as quickly as possible.
Any propellant for the manoeuvring jets would be in limited supply.
However the inclusion of simple piloting controls could mean that a pilot can override the automated landing sequence, depending on terrain that is identified as hazardous during the landing phase. The page on the Escape Pod specifications doesn't provide any details as to how much those "simple controls" allow to override the automated systems.
In my personal opinion those "simple controls" would only be used for an emergency change of landing zone.
So far nothing I've found suggests that R2-D2 was attempting to pilot it to Obi Wan.