How does dodge work in League of Legends? Could it happen only if you are target of auto-attacking or also when enemy uses abilities like, for example, Ashe Volley?
You cannot dodge abilities (whether auto or not) nor turret attacks. This link provides more detail as to why this isn't possible.
The bottom post at the link sums it up nicely:
You can't dodge abilities, even ones that channel through a character's autoattack.
You can't dodge turrets, though I think pre-nerf Jax used to be able to.
Yes, you can dodge while casting and being attacked from behind.
Straight from League of Legends - Champion Stastics
Dodge: Dodge gives your champion a chance to completely avoid an enemy physical attack. Attacks avoided in this way will deal 0 damage and will not apply 'on-hit' effects. However, abilities which significantly modify the champion's attack such as Twisted Fate's Pick a Card, Nidalee's Takedown, and others will always strike, even when dodged. Dodge scales multiplicatively, meaning that if you have two sources of dodge each providing 10%, you would have 19% dodge (0.9 chance to be hit * 0.9 chance to be hit = 0.81 chance to be hit)
However it should be noted that there has been report of a bug/glitch with Poppy's Devastating Blow that causes Poppy to "Miss" or the target to "Dodge" the attack when the ability is activated prior to the end of the previous attack animation. Also, the description right from Riot seems to indicate that the dodge text may still appear on attacks like Nasus's siphoning strike while the ability will hit anyway.