Your question is ambigious. Are you trying to fit a spline to a spline or some data you don't know its nature?
You can't easily, given a spline curve, to fit a spline over it and reclaim the original spline parameters, as you need to know exactly the break points and the order of the spline. However, if you are talking about data, you can fit a spline or polynomial over the data as you see fit.
For polynomial you use the polyfit function, which performas a least square regression to find the equation of the polynomial.
is the spline fitting function.