Wel, in a trainer battle, forfeiting is forbidden. Clicking the "run" button will result in a message saying:
"No! There is no running from a trainer battle!"
But in wild Pokemon battles, if you don't want to battle the Pokemon, simply click the run button. But sometimes, you won't be able to click run, mainly because the wild Pokemon may be faster then your Pokemon