Depends on the anime.
Take… Code Geass, for example. Many of the characters wear skintight body suits, and are very… shapely. However, that’s not a focus of the anime and it doesn’t really revel in it. It’s simply an aspects of the artistic direction. In cases like that, it’s up to whether or not it causes you moral concern or difficulty. If seeing such things elicits lust in you, avoid it.
My Hero Academia is another example where certain outfits are provocative, but also actually serve a story purpose. They’re not provocative specifically for the purposes of titillation.
On the other hand, you have innumerable other shows where the dress is immodest (or practically non-existent) specifically for sex appeal. I could probably name a few dozen examples off the top of my head, just because of how common this sort of thing is in modern anime. I would argue that it is not morally licit to watch this sort of anime.
I miss the times when Love Hina or Tenchi were considered risque. Nowadays they wouldn’t even register as a blip on the ecchi-scale.