Hello,
It is possible, but you may not want to do it! It is about 8hrs!
The first stretch is the new(ish) JR Shin-Hakodate-Hokuto shinkansen line that takes you to Shin-Hakodate-Hokuto Station just outside of Hakodate. This trip is about 4 hours and you can get a good glimpse of Northern Honshu on your way.
The train is quite new and has accessible seating and accessible toilets as well as a food trolley.
You then need to switch trains to the Hokuto Limited Express train to get you the rest of the way to Sapporo – taking about 3.5 hours. (NOTE: Until March of 2020, the train was called “Super Hokuto Limited Express”, but the “Super” was removed.)
There should be enough time to leisurely change trains. For example, the 9:36 shinkansen from Tokyo arrives in Shin-Hakodate-Hokuto at 13:34 and the train to Supporo departs at 14:12, so you have about 30 minutes to get something to eat etc. (you should be waiting at the train about 5-10min before departure). However, if you miss it, or want to leave extra time, there are departures at 16:55 and 18:11 … the last one for the day is 20:13.
The Hokuto Limited Express has accessible seating and a larger accessible toilet in the 5th train car.
Though, you may want to spend a day in Hakodate as there is a lot to see and do there considering its size!
Hope this helps 🙂