"Can I use this function for random data?"
Yes. However, the interpolation will not be meaningful unless the random data is correlated at higher orders than you interpolate at. For example you might be able to do some meaningful linear interpolation of a random function of two variables that can be expressed through a covariance matrix.
"especially for the application of ode"
Yes, you can do interpolation within the objective function for one of MATLAB's ode* calls. However, the interpolation that you use must be continuous to at least 2 more derivatives than the highest derivative that you are using in your ode, and must be continuous to 7 more derivatives than the highest derivative that you are using in your ode if you configure the ode to use RK45.
For example, if your ode used only a single derivative, f'(y), and you did not use RK45, then you could use cubic interpolation as that would be continuous to the 3rd derivative (2 more than the single derivative you are using.) However, if you used second derivatives f''(y) then you would not be able to use cubic spline interpolation without problems, because that is only degree 3 which is not at least 2 higher than the 2nd derivative f''(y) needs.
If you use linear interpolation, then the ode solvers will get stuck. If you use interpolation of degree 2, then the ode solvers will not necessarily get stuck, but they will produce incorrect answers if they do not get stuck.