Correctly wire up a Switching Regulator
There are several calculator tools you can use to make the calculations (or you can use the equations of the datasheet). One of them is this spreadsheet available from ONsemi.

If you set the output to 5v and the input to 6v then you will get an error because the calculated duty cycle becomes more than 84%. For 5v in step down mode you'll need about 7.5v minimum input.


  the optional filter is shown that \$ Vout = 1.25(1 + \frac{R2}{R1})\$


That equation is not related to the filter but to the output voltage of the step down circuit, the filter is just used to reduce the ripple of the output.


  If so, what is the advantages of varying input voltages or is it simply flexibility?


If the output voltage changed when the input voltage changed (within limits of course) then this wouldn't really be a voltage regulator.