The only similarity is that they both involve the underlying form and surface form right?
A few abstract properties are the same (sometimes the terminologies is different, but that is not a real difference). One that the grammar computes the relationship between underlying form and surface form. Another is that the grammar is a set of ordered computations on representations (in RBP the computation is a string-to-string mapping and in OT it is a string-to-star mapping – there is a trivial terminological difference, "ordering" vs. "ranking"). OT and the simultaneous-application theory of SPE are the same in that the computation is performed simultaneously on all elements of the representation (in contrast to the iterative subtheory of RBP which applies in a specific direction). It is hard to say how the two compare in terms of the formal theory of the computation since only a few aspects of OT constraints have been formalized, but the theories seem to share the same theory of matching the representational string to the rule/constraint string (the structural description, or the template of that which is forbidden).