ConfirmFormBase has a getCancelUrl() method, which points to what is usually some kind of parent for the form. This requires a URL string pointing to the router path - i.e. admin/config/foobar
However ConfirmFormBase itself is designed to be used as a route controller - and those, by design are path independent (as will their 'parent' be when those are converted. So really I'd expect this method to provide arguments to pass to the generator as opposed to an actual path - then if the parent gets moved somewhere, that'll work too.