I know, sometimes it can explode
To ensure this to a very high degree (no pun intended) that this doesn't happen, always make sure to use official or certified cables and accessories to charge your iOS device.
While it is true that Lithium-ion batteries age with the number of charge cycles depleted (which as I understand you are trying to cut down on), there are other factors as well that affect battery health, such as extreme temperatures and storage considerations. From the Apple Support document, iPhone Battery and Performance:
A normal battery is designed to retain up to 80% of its original capacity at 500 complete charge cycles when operating under normal conditions.
Additionally, there are other relevant documents from Apple that includes tips on how you can maximize the lifespan of your iPhone's battery.
In general, you can leave your iPhone plugged into power and use it, unless the device doesn't heat up, exceeding the recommended temperature range. This could happen due to use of an unofficial/uncertified accessory, presence of a case or using an app which taxes the hardware thereby causing device heat-up.
Avoid charging or leaving the iPhone in hot environments, including direct sun exposure, for extended periods of time.
Apple also recommends to keep your iPhone updated to the latest available public version of iOS for your iPhone as Apple software updates often include advanced energy-saving technologies.