Engineered mode coupling in multimode fibers and microcavities