As a practicing Anglican, I can answer this question. The churches of the Anglican Communion recognize the validity of Holy orders conferred by the Roman Catholic Church, so that a Bishop, Priest or Deacon who converted from Catholicism to Anglicanism, would remain a Bishop, Priest or Deacon, and could serve in the appropriate roles in the Anglican Church, subject to the relevant canon(s) of the various constituent churches of the Communion. It is also probably true, that a Catholic Bishop, Priest, or Deacon could be permitted to exercise his role in an Anglican church on a one time basis. In either case, though, whether a full conversion or a one time event, this would violate Roman Catholic canon law, and the Catholic Priest, Bishop, or Deacon, would likely be automatically excommunicated by virtue of having performed the act.
As far as going the other way, the Roman Catholic Church does not recognizerecognizes Anglican orders as being valid"absolutely null and utterly void" (Pope Leo XIII's Apostolicae Curae §36), so an Anglican converting to Catholicism would likely have to be re-ordained, or have other dispensation from Romeordained in the Catholic Church. This does, in fact, happen, and there are some number of Anglican clergy who have converted, and been ordained, or received a dispensation, and who serve as Priests in Roman Catholic environments, even when those Priests are married.