The questions from the OP are:
What happens if a tourist runs out of gas on the autobahn and not aware of German autobahn law, how to cope with this situation?
Drivers finding themselves in this predicament can be subject to fines?
Penalty is same for everyone regardless of nationality?
The key point in question is, naturally, the Latin phrase ignorantia legis non excusat — not knowing about a law does not excuse and does not prevent punishment (in German, the phrase is often cited ‘Unwissenheit schützt vor Strafe nicht’, which explicitly includes the punishment). This is also relevant to contraventions and most ‘illegal’ things relevant to drivers and driving are contraventions. § 11 of the Ordnungswidrigkeitsgesetz (OWiG, contravention law) reads:
§ 11 Irrtum
- Wer bei Begehung einer Handlung einen Umstand nicht kennt, der zum gesetzlichen Tatbestand gehört, handelt nicht vorsätzlich. Die Möglichkeit der Ahndung wegen fahrlässigen Handelns bleibt unberührt.
- Fehlt dem Täter bei Begehung der Handlung die Einsicht, etwas Unerlaubtes zu tun, namentlich weil er das Bestehen oder die Anwendbarkeit einer Rechtsvorschrift nicht kennt, so handelt er nicht vorwerfbar, wenn er diesen Irrtum nicht vermeiden konnte.
Loosely, this translates to:
Who at the time of infraction is not aware of a circumstance that belongs to the offense is not acting with intent. The possibility of penalties due to neglecting behaviour remains.
If at the time of infraction the offender does not realise they are doing something illegal because they did not know about the existence or applicability of a regulation, they cannot be penalised if they couldn’t avoid the error.
So which paragraphs actually apply? For one, there is § 18(8) of the Straßenverkehrsordnung (StVO, traffic code), which disallows stopping on motorways. This includes parking. There is also § 18(9) which forbids pedestrians entering the motorway. For these, the Bußgeldkatalog (penalty catalog) defines the fines of €30 (stopping), €70 (parking) and €10 (entering as a pedestrian). Since these values are defined in annex 1, (fahrlässig begangene Ordnungswidrigkeiten — carelessly committed contraventions) § 11(1) of the OWiG does not apply.
§ 11(2) applies if you could not under reasonable circumstances have found out about the existence of such a law. However, that doesn’t apply at all. Since there was no exceptional haste involved in renting a car/travelling to Germany, you could have, under reasonable circumstances, found out about the rule that disallows you stopping on a motorway and leaving your car. You are expectet to read up on travel regulations before you enter a country. This is akin to being required to know that in Germany a red traffic light means ‘stop’ and not ‘stop, but if you want to make a right turn proceed cautiously’. So § 11(2) won’t help you, as many internet sources including this one state. In theory, the fine applies.
In practice, the police often have better things to do than to check up on a car that is standing on the sideline. They have all reason to assume just a regular breakdown. Since you cannot evade a breakdown if it happens, you cannot be liable to pay a fine in that case. Thus, chances are high that you will get away with it. Unless of course the police see you refilling from your jerrycan — if they catch you doing that it is very likely that you are wrongdoing. Be prepared for questioning and a good excuse.
The best (and safest) strategy if you ran into the situation is to call a service car to tow you to the next petrol station (or off the motorway; whichever is quicker — note that an additional fine applies for not leaving the motorway at the earliest possible moment when towing). If one is just in sight, you can attempt to get away with walking over there, buying a 5 litre jerrycan and filling your car with that.
Naturally though, the prime strategy is not to run into the situation at all. Every petrol station on the motorway will be accompanied by a sign noting the distance to the next one, giving you enough time to decide whether you want to risk it. And of course, it is least hassle to just not run into the situation altogether.
The above text should have answered the first and second question. For the third, different fines for different nationalities would be a violation of the European anti-discrimination act if European nationalities are involved — this is the key point why the currently discussed road toll cannot be implemented in its current form. Regardless of European legislation, any differentiation according to nationality (except where something only applies to foreign nationals per se) would be considered discriminatory and likely not make it past the constitutional court. So yes, in theory all fines applicable are the same for everybody regardless of nationality.