I will be visiting UK for three weeks in July.
First week in Oxford, second week in Edinburgh, third week in Oxford again.
Are there any public transport tickets which might be useful for travel within UK?
In general, public transport outside London is quite a bit more fragmented than in London, with multiple different companies not always accepting each other's tickets.
In Oxford, consider walking: everything you'd want to see as a tourist is within quite a small radius, and given how busy it can get, you might get around faster on foot than in a vehicle.
There's no local rail within Oxford, so it's buses only in terms of public transport. This ticket provides 5 days of travel for £17 and covers Oxford Bus, Thames Travel and Stagecoach buses.
Again, you're mainly looking at buses, although there is a small tram network. This page from the tourist agency might be helpful. The main bus operator seems to be Lothian Buses, ticket details here.
To get between Oxford and Edinburgh, your best options are trains (under an hour Oxford-London, then about 4h30 London-Edinburgh), or flying from London (around an hour in the air, plus the usual airport hassle).
* You can book the same train tickets on the website of any train company, I've suggested LNER here because they operate London-Edinburgh and you can choose your seats if you book direct.
Are there any tickets that may be useful to you? Yes, many.
Is there any one ticket that will be of use to you in all locations? No - with the possible exception of a http://www.britrail.com/ pass for travelling between Oxford/Edinburgh, and going on excursions out of those cities.
With regards to Oxford, the local government provides this page - https://www.oxford.gov.uk/info/20012/parking_and_travel/495/public_transport - there are several bus companies in the Oxford area with their own ticketing regime, but apparently Oxford Bus to operate a unified bus ticketing system https://city.oxfordbus.co.uk/smartzone/
Edinburgh is a bit more unified, with the newly formed Transport for Edinburgh, but again they don't seem to provide unified tickets evne for their two services (Tram + Lothian Bus), never mind with the other bus companies and rail services operating in Edinburgh.
Other answers have already pointed out the options for local travel in Edinburgh and Oxford - in short, either walking or Smartzone for Oxford and Lothian Buses's offerings for Edinburgh. In addition to these, if you want to travel further afield — if you'd like to do some walking in the Cotswold hills around Oxford, for instance, or have a day trip to Glasgow or maybe the Scottish Highlands from Edinburgh — you can buy train tickets for short-distance travel on the day; either a return ticket (round trip), or a special ranger/rover ticket which gives you unlimited travel in an area - for instance the Cotswolds One Day Discoverer gives you unlimited travel for one day on trains between Oxford and Moreton-in-Marsh and on certain bus routes. For Scotland, there are multi-day rovers available, but they're reasonably expensive, so I would recommend just getting a return ticket for whichever journey you're making that day; this will probably work out cheaper unless you're doing a lot of rail travel.
For getting from Oxford to Edinburgh, I would recommend travelling by rail — unless you get a particularly good deal on flights it'll probably work out cheaper all things considered (ie getting to and from the airport, etc.), a more pleasant experience, and you get good views of the whole country.
First of all, you might want to consider buying a railcard. You can get a railcard for a variety of purposes — if you're 30 or under (either a 16-25 Railcard or a 26-30 Railcard), if you're two adults travelling together (a Two Together Railcard), if you're travelling with children (a Family and Friends Railcard), if you're 60 or older (a Senior Railcard), and more. All of these except for the 26-30 Railcard can be bought at the ticket office at Oxford (just bring a passport-sized photo), and all can be obtained digitally online. They cost £30 and give you 1/3 off travel; they usually have some restrictions so check the specific railcard that applies to you, but generally speaking if you're going to spend over £90 on trains they're worth their cost.
When travelling by train you have two main options for tickets — you can go for flexibility, or you can aim for a low price. Trains in the UK with a few exceptions do not have mandatory reservations, so it's always possible to buy a ticket that will allow you to just catch any train (perhaps with some time restrictions to stop you travelling at the busiest times) — this is known as a walk-up ticket, because you can just walk up to a station and buy it.
Separate to this, you also have two main routes you can use (though more are possible, these are the quickest, most direct ones) - you can travel via London, or via Birmingham. Via London will involve catching a fast GWR train from Oxford to London Paddington, then catching a London Underground (Hammersmith & City or Circle Line) train from there to King's Cross, and then catching a fast LNER train from there to Edinburgh via the East Coast Main Line.
Travelling via Birmingham, you would catch a CrossCountry train from Oxford to one of various stations such as (depending on the time of day) Birmingham New Street, Birmingham International, or Wolverhampton (I would recommend avoiding a change at Birmingham New Street if you have the choice, as it's not a particularly pleasant station environment and is also quite a large and confusing station), and from there catch a Virgin Trains service to Edinburgh via the West Coast Main Line. Some itineraries will alternatively take you via York where you will change onto an East Coast Main Line train, and there is actually one CrossCountry train a day each way which takes you directly from Oxford to Edinburgh with no change of trains. All of these routes will have the train travel via Birmingham even if you don't change trains there, so for simplicity I will refer to these as via Birmingham. The CrossCountry services can get particularly busy depending on the time of day, so if you're going this route I'd recommend trying to get seat reservations (fortunately CrossCountry make this relatively easy).
The former is likely to be slightly slower (though I've just checked and there isn't really much in it; it's around 6:15 for the former and 6 hours for the latter) due to the time taken to travel across London, but you might find it a more interesting and pleasant journey. If you want an easier trip, though, with just one change of trains, it's perhaps worth going with the latter. It's ultimately up to you.
Finally, it's worth remembering that we have an integrated ticket system — despite different train companies being involved, the ticketing is unified between them all, and you should usually be able to purchase just one ticket to complete any given journey. Oxford to Edinburgh is no exception to this.
If buying walk-up tickets, it almost always works out cheaper to buy a return ticket (ie round trip) rather than two singles (one way). You can buy a walk-up return ticket from Oxford to Edinburgh via Birmingham (an "Off-Peak Return" with route "Not Via London") for £155.30 (this doesn't allow travel before 09:30 on weekdays), or via London (a "Super Off-Peak Return" with route "Via London") for £168.40 (this has restrictions on the times you can depart/arrive London King's Cross to/from Edinburgh on weekdays, see the exact restrictions here - note that these restrictions don't apply to the leg between Oxford and London).
But if you comply with these restrictions you're allowed to travel on any train on one of these tickets; you can buy the ticket on the day of departure from the station (either from the ticket office or a ticket machine), or in advance online (from any UK train operator's website, eg LNER or CrossCountry), and it will cost the same and have the same restrictions (if you buy it in advance you can get seat reservations, which are free, but you aren't required to follow them), and don't have to choose which train you're travelling on in advance at all. You're even allowed to travel out one route and back the other if you pay the difference (if you ask for a "change of route excess" from the train guard).
If you're happy to tie yourselves to specific trains in return for a potentially cheaper price, you can look online for Advance tickets. Advance tickets always give you seat reservations, and in fact these are required for the ticket to be valid. Advance tickets still give you some rights - for instance, if you miss a train due to a delay caused by the railway (no matter which railway company caused it), you can catch the next one by the same operator without penalty. But it's generally difficult and expensive to change these (you can change them in advance of travel at a ticket office only for a £10 admin fee, but if your travel time has passed (ie you've missed your train) the ticket becomes completely invalid and you have to buy a new one), so if you think you're likely to want to, I'd stick with the walk-up tickets.
Advance tickets are easiest to buy online. They are only available as single (one-way) tickets — you simply buy two of them if you want a return trip. You can buy them from any train operator's website, eg LNER or CrossCountry) — search for train times until you find ones which are cheap and work for you, and pick them. Note that advance tickets are only available a few months in advance, so check on this page, being sure to look at all the train operators you will be travelling with — if just one of them hasn't yet released their advance tickets, you won't be able to buy one for the journey at all (in general; there are a few exceptions to this but not important enough to go into here). Within this time, though, the further in advance you buy them the cheaper they'll be; close to the date of travel they might be sold out entirely, or with very little price difference to a walk-up ticket, so check that your saving will really be worth the restrictions.
Once you have bought an advance ticket you will pick it up from a ticket machine (NOT a ticket office) at your departure station, usually needing your payment card and the pickup reference they will have emailed to you.
In some cases it can be cheaper to use a combination of multiple advance tickets rather than just one (though you can always use just one!). Sites such as Trainsplit can calculate these for you. It's perfectly valid and legal to do this; you CAN end up putting more restrictions on your travel though (though with advance fares especially the point is usually moot). If you're comfortable doing this to save money, this might be worth a look.