Pokemon Ultra Sun/Moon is basically an upgraded version of Sun/Moon, with different features. If you've played Sun/Moon, a lot of the events will be recognisable in Ultra Sun/Moon. However, you don't have to have played one to play the other, and it probably won't lessen your enjoyment significantly.