Common cathode LED resistor with 4017 decade counter
Yes you can, however it will subject the 'off' LEDs to reverse bias. If you are using a 5V supply or less, worst case will only be a few volts, which virtually all LEDS are rated for.

If you are using a CD4017 on an 18V supply, you will be exceeding the reverse rating of most LEDs-- typically 5V or so-- (but it might still work).

Each 'off' LED sees the output drive voltage (typically close to the supply voltage) minus the forward voltage of the 'on' LED (typically 2-3V, or maybe 1V if the LED is an IR type).