Dwarf galaxies and globular clusters