Dodge isn't always an action. If you are a Monk, you can Dodge as a bonus action - otherwise, it is always an action. You have to get creative if you want to avoid an attack.