There are no known risks associated with using a flash drive while it is charging. However, you should check that the flash drive and charging apparatus are both reliable.
It is recommended to use a reputable brand and to never leave charging devices unattended because some low-quality charging devices or flash drives may overheat and cause a fire.