I'd say most smartphones are powered on 24/7 during their regular phone lifetime. Not much would change by turning a phone into a 24/7 webcam, if viewed from that angle. Then again, CPU load would certainly be higher when used as a webcam.
Having it plugged in, OTOH, probably doesn’t matter. There’s safety IC to prevent overcharging. Actually fully draining, mechanical damage, water damage etc. are more dangerous, which can happen during normal use anyway.