The short answer is yes, you can get to Merced on the day you arrive but it would be a really long day. Greyhound or Amtrak can get you out of San Francisco late pm/early evening arriving at Merced maybe 9pm. Assuming you are flying from England that will be almost 24 hours total travelling time.
I’ve done that trip a few times and have always stayed in San Francisco at least one night. I have then either travelled to Merced for a night then caught the early bus to Yosemite arriving mid morning, or gone direct from SF to Yosemite leaving early morning, arriving early afternoon. Shopping for supplies and mail drop can easily be sorted out whichever way you go.
Once you get to Yosemite, I’m afraid the Sequoias are a long way from the trail. Its about 12+ miles from Yosemite village by road to the groves and I don’t think there is any public transport going that way. Once you start the JMT you are heading away from them.
If you really want to see the Sequoias, how about renting a car at the end of your hike to get back to the airport. You could see the Yosemite or Sequoia/Kings Canyon trees and go to Muir Woods north of San Francisco for the Redwoods.
Enjoy your trip.
Phil B