You can purchase a Bayern-Ticket online, but they come with the validity date printed on them and they are non-returnable, so you can only use them on that date. But you can always buy them at train stations just before travel, so the only reason I can see for advance purchase online would be if you were coming into Germany from another country and wanted to start using it before you would have a chance to get it from a station. For instance, if you were coming from Prague on the direct train to Munich that crosses the border just before Furth im Wald, you could purchase the Bayern-Ticket online, then buy a ticket to Furth from Czech Rail in Prague (about 11€). You would use the Czech ticket to the border and the Bayern-Ticket from there to Munich or wherever in Bavaria you were going.
I have ridden the S-Bahn in Munich many, many times, and only once did I see a ticket inspector. And many times I've ridden regional trains without having to show my ticket. Only once did I not have my ticket checked on an ICE (Bad Schandau to Dresden, 28 minutes, a short distance). I don't think you will have your ticket checked between Marienplatz and the Hbf. I assume you are going to Marienplatz to catch a train to somewhere else using the Bayern-Ticket. You could have purchase the Bayern-Ticket in the station at Marienplatz.
And, although the tickets printed at an S-Bahn station are too wide for the cancelling machines and have the date already printed on them, tickets purchased in U-Bahn stations are narrow, not dated, and have to be cancelled. In all cases, look at your ticket. If it has arrows (triangles) on the end and says "Hier entwerten", it has to be cancelled.
According to this MVV webpage, if you buy a ticket from an automat in an S-Bahn station, you will be given the choice between already validated tickets and ones that have to be validate (this being so you can buy tickets ahead). It doesn't say if this applies to Bayern-Tickets, but you should be aware. If you can, and you do buy an un-validated ticket, you will need to stamp it.
To buy a Bayern-Ticket online on the Bahn website, put in any regional route long enough to show the Bayern-Ticket as a savings ticket. It doesn't have to be the route you want to use; once you buy it, the Bayern-Ticket can be used anywhere in Bavaria. Note, this doesn't work with the Bayern-Böhmen ticket, which can only be purchased online from the Bahn store (in German).