With an index, coordinate values are immutable because they are backed by a pandas.Index (which has immutable values).
So it's most straightforward to replace a coordinate variable wholesale with something else, e.g.,
In [31]: ds = xr.Dataset(coords={'x': range(3)})
In [32]: ds['x'] = [5, 6, 7]
In [33]: ds
Out[33]:
<xarray.Dataset>
Dimensions: (x: 3)
Coordinates:
* x (x) int64 5 6 7
Data variables:
*empty*
In [36]: ds['x'] = 2 * ds['x']
In [37]: ds
Out[37]:
<xarray.Dataset>
Dimensions: (x: 3)
Coordinates:
* x (x) float64 10.0 12.0 14.0
Data variables:
*empty*
You can modify values with indexing if you convert to an ndarray and then reconstruct the coordinate. In principle, it should also work to modify a copy of a DataArray created from an index (e.g., ds['x'].copy()), but currently that remains immutable: