It also depends on the breed. Some dogs are sighthounds (such as Greyhounds), and they can NEVER be offleash because as soon as they SEE something, they will run after it, at 45MPH. Most other families of dogs, retrievers, shepards, huskies, etc...should be fine...just make sure you have taught the doggy his or her name and teach it the "come here" command first. That way, if you let him off leash and he gets into trouble, you saying the "come here" command should force him to come back.
TO teach the come here command, do it indoors, with positive reinforcement such as treats...