The Stata functions max() and min() require two or more arguments and operate rowwise (across observations) if given a variable as any one of the arguments. Documented at e.g. help max().
The egen functions max() and min() can only be used within egen calls. They could be applied with single variables, but their use to calculate single maxima or minima is grossly inefficient unless exceptionally it is essential to store the single result in a variable. Documented except for the warnings at help egen.
Neither approach you consider will work without becoming more roundabout. Consider
su x, meanonly
gen x_index = (x - r(min)) / (r(max)- r(min))
In some circumstances it might be more efficient to calculate the range just once:
su x, meanonly
scalar range = r(max) - r(min)
gen x_index = (x - r(min)) / range
In a program it would usually be better to give the scalar a temporary name.
Within egen calls, an egen function can be called only once.