We study fluctuational transitions in discrete and continuous dynamical systems that have two coexisting attractors in phase space, separated by a fractal basin boundary which may be either locally disconnected or locally connected. Theoretical and numerical evidence is given to show that, in each case, the transition occurs via a unique accessible point on the boundary, both in discrete systems and in flows. The complicated structure of the escape paths inside the locally disconnected fractal basin boundary is determined by a hierarchy of homoclinic points. The interrelation between the mechanism of transitions and the hierarchy is illustrated by consideration of fluctuational transitions in dynamical systems demonstrating "fractal-fractal" basin boundary metamorphosis at some value of a control parameter. The most probable escape path from an attractor, which can be either regular or chaotic, is found for each type of boundary using both statistical analysis of fluctuational trajectories and the Hamiltonian theory of fluctuations.