Some characterizations of regular duo rings and semigroups