Yes - to clarify, if you attack an enemy unit when another unit of yours is next to them, you will get a flanking bonus. It's a good idea to surround an enemy with as many of your own units as you can before launching your attack so that you can maximize the bonus from flanking.
It's a great strategy to use for taking down tough units or if you just want to take a unit out quickly.
Prior to the era of modern warfare, mounted units tend to be best at flanking enemies because of their additional speed and their ability to move after attacking.
Oh - and remember that the enemy can (and sometimes will) do the same to you, so try to keep your own units in positions where it would be difficult for them to be flanked.