In theory, it is possible to generate electricity using a vacuum cleaner, but it would not be practical or efficient for normal use. Vacuum cleaners are designed to consume electricity to power their motors, which create the suction needed for cleaning.
To generate electricity using a vacuum cleaner, you would need to modify it significantly and introduce additional components, such as a generator or dynamo. The basic concept would involve using the vacuum cleaner's motor as a generator by spinning it manually or through some external force.
However, the amount of electricity that could be generated this way would be minimal and not worth the effort compared to other more efficient and reliable methods of electricity generation. Vacuum cleaner motors are typically not designed or optimized for generating electricity, and the energy losses involved in the conversion process would be significant.
For practical electricity generation, there are various established methods like using power plants, solar panels, wind turbines, hydroelectric systems, and more, which are much more effective and viable for powering homes and industries.