Answer:
To conduct electricity, compounds need to have charged particles and be able to move. Acids and bases can do both of those things:
Charged Particles
Acids and bases can dissolve to form ions which are charged particles. NaCl forms Na+ and Cl- ion, hence it can conduct. However, say you take sugar in water, it doesn't conduct because it doesn't form ions.
Movement
As the acid/base is in a liquid medium (the solution), they can move.
Hope that helped and feel free to ask more questions!