I want to purchase a separate ticket from San Francisco to New York and then fly from New York on the same day with a separate ticket to Germany. I can save money by doing this but do not know if airlines allow this. I'm interested in answers for relevant for both legs on a single airline, or on separate airlines.
How exactly would they "not allow" this? What do you imagine they could legally do to prevent it?
However, it usually has severe disadvantages for you:
I did it once many years ago with a low cost airline that only sells point-to-point tickets (like Southwest but in Europe). As others already mentioned, the downside is that you cannot expect any help from them if you miss the connection (i.e. you might lose the money you spent for the second leg and have to buy another ticket at a premium on the spot or at least pay some extra fee to change the ticket; in the worse case, the return journey for the second leg might be invalidated as well).
Since I also had to collect my luggage and drop it off, go through a passport and security check again (low-cost carriers typically don't offer any connection), it was all really tight even though I had several hours between the flights. That's the reason why you might come across language that strongly discourages it but beyond that, I don't think airlines really care.
Note that some airlines might require you to claim your luggage as a matter of policy but strictly speaking it's not always necessary even if you don't have a single booking for the whole trip, see Can I through check my bags on separate bookings (international flights)? With a bit of luck it could all go very smoothly – but personally, I still wouldn't risk it.
Another issue that hasn't been mentioned yet is that if you want to benefit from a transit exemption in a country for which you would otherwise need a visa, it might be impossible to collect your luggage and remain airside without the airline's assistance (that's not relevant in the US but that's something to keep in mind for other people considering a similar trip elsewhere). Worse case here is that you could be refused boarding on the first leg because you don't have a visa for the destination (that's what happened to the person who posted the earlier question).