Can I run a script as background daemon or service on shared servers 24/7?

No, this is not allowed on shared/sdx/reseller servers. You will need to get a vps or dedicated server for this.