Yes there was a time that one could just show up and buy a ticket, maybe it still is so for the locals, honestly I don't really know. Anyway R. Premadasa stadium is a very big one but since it is situated in the center of Colombo tickets can be sold out easily and since the Galle where the other ground is situated, is a tourist area and also a much smaller town than Colombo it might could be hard to find accommodation right near by the ground. If you are going to watch both matches it's a 12 day tour in two locations so better to buy tickets in advance and also arrange some kind of accommodation before it will be unnecessarily expensive. Cheers!