Most derailleur pulleys use simple sleeve bearings, which are dead-easy to clean. Some fancier models may have sealed cartridge bearings, which shouldn't need service. And some old-school derailleurs actually use loose balls in a cup-and-cone system.
There's no compelling need to replace them unless the pulley falls apart. I have some that are 30-40 years old and still going strong.