To change the ellipsoid used by the globe to use the Mars ellipsoid, you’ll need to create a new Globe object and pass in an ellipsoid with the appropriate x/y/z values. For example:
var viewer = new Cesium.Viewer(…);
viewer.scene.globe = new Cesium.Globe(new Cesium.Ellipsoid(…));
You’ll then need to configure imageryLayers on the new Globe object to add the appropriate Mars imagery.
There are likely to be other Earth-specific assumptions in the code. For example, you’ll want to remove Earth’s moon.
viewer.scene.moon = undefined;