Unfortunately, your question cannot be answered definitively. It depends on how long your trip is planned for, how much you like to have your own bike with you, and the hassle factor in the country you are thinking of buying and selling in.
For less than 6 months, buying and re-selling may be a good choice, especially in countries like Australia or NZ where cost and logistics of shipping in both directions may be fairly onerous and purchasing and reselling in the country is not difficult. There are also countries in South America where purchasing and reselling is possible, notably Chile. See this post
For a really long trip (6+ months), especially to less developed countries, and/or where you want to go off the beaten path and camp, it's probably worth shipping your own bike set up the way you want with lots of luggage capacity etc.
The costs you have to compare are the depreciation / loss of value of the purchased bike vs. the cost of shipping in both directions. If you ship by sea, there is also the cost of remaining in a location for potentially several months without transport while you wait for the bike. Also, keep in mind that if you ship your own bike and put the miles on it, that presumably reduces its resale value too.
As for registering the bike when you are not a resident, in some countries it is no problem, in other countries it is impossible, and in many countries it can be done if you know the right person who will allow you to use their address, possibly the dealer you buy the bike from.
If you can be more specific as to which countries you are planning to travel to, undoubtedly there will be someone on this board who can advise you.
Hope this helps a little!
"It matters not what goal you seek
Its secret here reposes:
You've got to dig from week to week
To get Results or Roses."
'One world, two wheels'