The electronic structures in the hierarchical self-assembly of GaAs/AlxGa1-xAs quantum dots are investigated theoretically in the framework of effective-mass envelope function theory. The electron and hole energy levels and optical transition energies are calculated. In our calculation, the effect of finite offset, valence-band mixing, the effects due to the different effective masses of electrons and holes in different regions, and the real quantum dot structures are all taken into account. The results show that (1) electronic energy levels decrease monotonically, and the energy difference between the energy levels increases as the GaAs quantum dot (QD) height increases; (2) strong state mixing is found between the different energy levels as the GaAs QD width changes; (3) the hole energy levels decrease more quickly than those of the electrons as the GaAs QD size increases; (4) in excited states, the hole energy levels are closer to each other than the electron ones; (5) the first heavy- and light-hole transition energies are very close. Our theoretical results agree well with the available experimental data. Our calculated results are useful for the application of the hierarchical self-assembly of GaAs/AlxGa1-xAs quantum dots to photoelectric devices.