Rules to know which particle phrases modify which verb?


In [this video](https://youtu.be/uO1rHcwjADA) the following sentence is
analyzed

> それはある女の子が先輩のアパートで行われた飲み会に参加した日

In the video we learn that ある女の子が is the subject of 参加した, while 先輩のアパートで
modifies 行われた. Put differently: the outer particle phrase modifies the outer
verb, while the inner particle phrase modifies the inner verb.

I totally understand that this is the right way of looking at this sentence
(given the meaning of the words, context, etc); however, **I am curious if it
is logically possible for ある女の子が to be the subject of 行われた and/or for 先輩のアパートで
to modify 参加した?**

Or are there rules like "the first が phrase must be the subject of the main
sentence (not any relative clause found within the sentence)", or other such
rules governing what can modify what (outside of pure context)?

