In the current study, we investigate the self-assembly of polystyrene-block-poly(4-vinylpyridine) (PS-b-P4VP) confined in the nanopores of the anodic aluminum oxide (AAO) template and the subsequent morphology transformation induced by the Rayleigh instability. PS-b-P4VP nanotubes and nanorods with various internal nanostructures are fabricated by wetting the AAO template with PS-b-P4VP/chloroform solution, and then followed by solvent evaporation. After the removal of AAO template by potassium hydroxide solution, several different solvents (chloroform, toluene, and N,N-dimethylformamide) with different qualities are used to swell and anneal those nanotubes and nanorods suspended in aqueous media. Morphology transformation from nanostructured PS-b-P4VP nanotubes or nanorods to ordered nanospheres is observed by annealing upon chloroform and toluene while the morphology remains unchanged upon N,N-dimethylformamide annealing, indicating that solvent quality is a key factor in tuning the morphology and internal structures. Kinetics study and theoretical analysis for the morphology transition from two-dimensional (2D) block copolymer (BCP) nanotubes and nanorods to three-dimensional (3D) BCP nanospheres are further performed. From the morphological evolution and the quantitative calculation, it is confirmed that this transition is induced by the Rayleigh instability. This study provides a simple but promising method, that is, solvent annealing method, for the fabrication of BCP nanospheres with ordered internal nanostructures, which may have great application in drug delivery and other nanotechnology.