Defense works by reducing the damage dealt by the defense value in a 1 to 1 ratio, with the exception that it cannot reduce the damage below 10% of the base amount. Thus if an enemy attacks for 100 damage, a unit with 0 defense would take 100 damage. 10 defense would result in 90 damage. 25 defense in 75 damage. 50 defense in 50 damage. 90 defense in 10 damage, 95 defense in 10 damage, 100+ defense in 10 damage.

MR on the other hand just reduces the magic damage dealt by that percentile, so 10 MR reduces magic damage by 10%, 20 MR would mean the unit only takes 80% of the magic damage. Overall fairly straightforward.