「あなたが一番{いちばん}したいことはなんですか?」
This sentece is perfect in every way and it means what you said -- "What is the thing you want to do most?".
Can が always be used to mark the one who desires something in a "~たい"-sentence, or is it something that is limited to relative clauses such as the one in the second example?
It is the latter.
「あなたが一番したい」 is a relative clause that modifies the noun 「こと」. Inside relative clauses, the topic/subject-marker is always 「が」. This 「が」 just cannot be replaced by a 「は」.
To use 「あなたは」(instead of 「あなたが」) correctly to say practically the same thing would be to say:
「あなたはなにが一番したいですか?」
Using 「は」 is correct and natural because it is not used inside a relative clause or any kind of sub-clause in the sentence just above.
is it okay to say "私がケーキを食べたい" or "私がケーキが食べたい"?
Only when the context calls for it, yes.
Let me first talk about English. Consider these two short conversations.
1) A: Who are you? B: I'm Bob.
2) A: Which one of you is Bob? B: I'm Bob.
Did you read B's two replies with the same intonation? I highly doubt it even though I know almost no English.
In Japanese, in 1) B would say 「ボクはボブです。」 and in 2), 「ボクがボブです。」. Surprised?
Back to your sentences..
If I asked you 「何が食べたいの?」(What would you like to eat?), you should reply 「ボクはケーキが食べたい。」 The focus is on what kind of food rather than who the eater is.
If, however, I asked 「誰{だれ}がケーキを食べたいの?」(Who wants to eat a cake?), you should reply 「ボクがケーキを食べたい。」 The focus is on who among the group, not what s/he wants to eat.
I know this is not easy, but you will get there one day. ← That part in bold was a 「は」 sentence, BTW. J-learners use 「が」 way too often and I have never quite understood why.