Generally:
AはBを食べる <-> Bを食べるA
but i do not think i can't rearrange this in terms of
~~~B
However if it its a sentence with an indirect object as well:
「昔は天の川に見立てた川に笹を流して願い事をする行事なんかもあった
compared with:
are all of the following correct?
昔は川を天の川に見立てた <-> 昔は天の川に見立てた川
YYがXXをプレッシャーにさらす <-> YYがプレッシャーにさらすXX
私はAにBをあげる <-> 私はAにあげるB
thank you for confirming