I'm residing in Germany and visiting the UK in the summer.
I do not know yet which Britrail pass I need, as the length of my vacation will be determined after I've already entered the UK.
Can I buy a Britrail pass while already in the country?
Sadly then no you can't.
From https://www.britrail.com/plan-your-trip/faqs/
Can I purchase a BritRail Pass when I am in Britain?
No. Please remember to buy your BritRail Pass before leaving your country, as BritRail Passes cannot be purchased when in Britain