Buying a bike in thailand isn't the problem, but it will be near impossible to get it registered in your name. For that you need a permanent address and documents proving that, along with a residence permit if I recall correctly, or a thai ID. To get any of these you must have lived there for an extended period of time, more than 3 months for sure if I recall correctly.
Now you could have the bike registered in someone elses name (thai national), but then you will most likely run into trouble when crossing borders. You will need a letter on non-objection from the owner, and hope for a lot of good will at the border. One reason for this is trying to crack down on bike theft in thailand.
As to border crossings, if the bike is registered in your name, and preferably registered in your home country, none of the border crossings are a problem, with the exception of Myanmar. A small exception to the statement before: it's not possible to cross with bikes at all border crossings, plus several smaller crossings, especially between northern Thailand and Laos are for locals only, so do check in advance whether you can actually cross there, before planning your trip using a map only. The best bet for crossing with a bike in the North is the friendship bridge.
Regarding Myanmar, maybe the situation has changed, but as far as I know it is not possible to enter the country with a vehicle. Some small towns at the border may be an exception, but I don't think it's possible to travel further.
You will find a lot of information regarding the current situation re border crossings, bikes, etc at Motorcycle Touring & Maps: Thailand : Laos : Golden Triangle
You may consider renting bikes. I have done that, both in Thailand and Laos and can give some tips. If you intend to cross borders with rental bikes, that takes some preparation though and may or may not be possible at all borders.
Good luck and enjoy your trip, I'm already envious ;-)
P.S. one more question: how much time do you have for this trip? If time is limited, it may be wiser not to try to visit all of southeast asia in one go and thus have to deal with border complications. There's a lot to see and experience in each of those countries, which may be ultimately more enjoyable than just rushing through not seeing any of it ...