Upvote:4
The edit makes this a different question - to me at least, and judging from the comment there's at least some agreement that my original answer (which had attracted one upvote, so it can't have been terribly far off) doesn't answer the edited question. My original answer is still present below.
When deciding whether they want to give you a visa the UK authorities looks at you and your circumstances. As they include the likelihood you'll leave the UK, where you can go might actually influence it. There are a lot more factors involved, so we can't guess what the UK authorities will do.
Original answer (to the unedited question):
Your plan involves leaving Schengen (Germany) before your Schengen visa expires, and being in the UK for a period where you'll have a visa for being there, so yes, you can do that (if you get that UK visa of course).