So the word order for this sentence is completely the opposite as in English, but can you rearrange the words to become 'Ülsz a fa alatt' or 'A fa ülsz alatt' since Hungarian word order is flexible? Thank you in advance for your answer.
"A fa ülsz alatt" doesn't work, it's not correct. But yes, the word order is very flexible, by and by you will understand it.
The word order is not totally arbitrary. There is rhyme and reason in the chaos. A sentence is made up of groups of words that are in a fixed position within their respective groups. The groups can be thrown around in the sentence but their inner order does not change. A group can contain one or more words. (I'm sure there is a scientific term for what I'm talking about).
Let's make this sentence a little bit more complicated:
"You always sit under the big tree with your best friend." "(Te) mindig a nagy fa alatt ülsz a legjobb barátoddal."
The groups I am talking about are these:
You - Te ("Te" is optional here)
always - mindig
sit - ülsz (means "you sit" - that's why "te" is optional)
under the big tree - a nagy fa alatt
with your best friend - a legjobb barátoddal
Now, as long as the inner order of these groups stays the same, you have much flexibility in arranging them into a sentence. Many permutations, although not necessarily all, will result in a correct sentence. Just one example:
"A legjobb barátoddal te a nagy fa alatt mindig ülsz".
Who knows what it means but it is a perfectly valid sentence. Especially in the right context.
And, who knows, maybe the English sentence can also be rearranged along the same lines. It would be unusual, to say the least.