"In order to get along with a Basenji, you have to be at least half as smart as the dog!"
What kind of fence do you have? Many Basenjis are great jumpers, some will use chain link as a ladder, and a few like to dig. Some won't bother trying to get out but I wouldn't count on it. Best solution is a 6 - 8 foot vertical board fence. If you have chain link you can attach something to the inside of the top, e.g. pvc pipe, which may deter the dog. If you don't have any option to change your fence, invisible fence backed up by the physical fence can work.
It's best not to leave the dog in the yard unsupervised in any case.....
To add to what Debra said about not chasing, I have found one of the most effective ways to recapture a loose dog that is disinclined to come to you is to lie down on the ground. Assuming they are paying attention and not in full chase of something, they will want to know why you are doing something so peculiar, and will likely come to check you out. If you are careful not to move until you are pretty sure you will be successful, you should be able to get hold of the dog. This may not work more than once! And be sure to give lots and lots of praise when you catch him!
I'd like to add, don't sneak out. The dog should know that you are leaving, because otherwise it may panic when it can't find you. I had a regular routine for when I was going out which involved loading my boy's roller ball, putting him on a "stay", placing the ball, and then releasing him with an "O. K." as I went out the door. This particular dog had had a separation anxiety problem and I found getting him to anticipate a "good thing" (his treat filled ball) when I chose to go out alleviated his concern about my leaving. On my return I always greeted him in a very low key way, never making a fuss over him. We got to the point where he often didn't get off the couch on my return! I knew then that I had the separation issue beaten.
A couple of hours shouldn't be a problem. With a dog that hasn't proven trustworthy you might want to consider a crate or restricting the dog to an area where there isn't much it can damage. Leaving a treat or toy to play with can help a lot. I found one of those balls that you put treats in and the dog has to roll the ball to obtain them is useful, or a Kong stuffed with something tasty. It can keep the dog occupied for awhile and make your absence less stressful. It's a good idea to make your departure and return very low key. Separation anxiety can be fed by people making a big deal out of their absence.
You may be able to work on this with a competent trainer, but I've had 5 Basenjis, two of which were dog aggressive and one of which was same sex aggressive, and it's not an easy thing to deal with. (my other two were just fine with dogs of either sex and any age). Going to a dog obedience class with the right trainer would give you a chance to work on the issue in a controlled environment, which might help. There are a number of approaches to this issue, but not all of them will be suitable for your specific animal. With my last boy, I just avoided confrontations by keeping him away from other dogs. And he too had been attacked by a large dog, which definitely made his responses worse. He was not going to wait to see what any other dog's intentions were, he wanted to get his licks in first!
Depends on the dog. Some consider chain link to be a ladder. My boy would easily scale a six foot fence, but vertical boards kept him in. Some will dig, some won't. Your yard would likely keep in a young pup, as long as there are no gaps to squeeze through, but I would supervise just in case.