Avebury is very easy to do from Bath by public transport- half hourly train to Swindon, then half hourly bus (hourly on Sunday) #49 to Avebury.
£15.30 Off Peak Day Return on the train, £6 bus fares
The bus at Swindon leaves from the new busway at Fleming Way (5 minutes from the station- straight ahead as you leave the station, then right at the T junction). The busway (as a point of interest) is built on the track of the former Canal which went through Swindon).
Stonehenge is usually done from Salisbury, but it is entirely possible to do on the same day as Avebury- take a later 49 to Devizes, change into the X2 at 1305 to Stonehenge, arrive 1354, depart 1640 back to Devizes then back to either Swindon on the 49 (arrive 1838) or Chippenham Railway Station on the 33 (arrive 1825).
Or even straight back to Bath (arrive 1840) on the 271 bus (which is hourly all day).
Chippenham is between Swindon and Bath on the same rail line.
Each bus costs £3. So 5 buses in all is £15.
Oxford to Salisbury you would usually do by train, but can be done by bus- the S6 to Swindon every 20 minutes, then the X5 every hour to Salisbury.
It's worth saying that from Stonehenge you can walk the processional way about two miles down into Amesbury, and catch the aforementioned hourly X5 straight back to Swindon (or Salisbury). Extra buses (route 8) run every 20 minutes, and the X4 every 30 minutes from Amesbury to Salisbury. So there are 7 buses an hour from Salisbury to Amesbury.
Link that with the X2 from Salisbury to Stonehenge at 1250 and 1350, or from Stonehenge at 0954, 1154 and 1354 and you have an easy round trip day out from Salisbury, without using the Salisbury to Stonehenge 'Tour Bus' - https://www.thestonehengetour.info/