the company I work for reports that most e-bike fires are caused by the use of incorrect / incompatible charging equipment. People modifying cheap e-bikes to keep them on the road because parts aren’t available must contribute a bit. We regularly get people at our service desk looking for electronic bits to keep cheap no name stuff on the road, unfortunately we can’t help.
At my previous job with an automotive manufacturer I was involved with investigating a “thermal event” ( the company said I couldn’t use the term “fire” ) It was caused by the customer using the wrong charger, darn near burned his house down.
personally I charge my wife’s e-bike outside and monitor it pretty carefully. Per the factory instructions I charge it when the charge drops to about 20% and charge it to between 80 to 90% of capacity. This is supposed to maximize battery life and reduce the possibility problems with the battery.