This paper investigates the effects of nonlinear soil behaviours on the structural responses of offshore wind turbines (OWTs) subjected to wind, wave and earthquake loadings. A novel seismic analysis framework (SAF) is developed for the assessment of seismic behaviours of OWTs with flexible and fixed foundations. The SAF consists of an improved QuakeDyn module that is implemented into an open source tool (FAST). SAF has been validated through benchmark studies using numerical tools and the results show good agreements. Fully coupled nonlinear simulations have been performed for OWTs with fixed and flexible foundations under operational, parked and emergency shutdown states. The flexible foundation is modelled using nonlinear p-y curves obtained using LPILE. For all the examined operating conditions, notable differences of magnitude and variation in the responses between the flexible and fixed cases are observed, indicating the need for soil effects to be accounted in seismic behaviour analysis of wind turbines. It is further observed that the earthquake induces more severe vibrations on wind turbines with a flexible foundation compared to the one with a fixed base. Also, aerodynamic damping dissipates more energy from earthquake excitation resulting in a smaller tower-top fore-aft displacement. The shutdown triggered by the earthquake causes a 34% increase in the mudline bending moment for the flexible foundation case, while a decreasing trend is observed for the fixed foundation model. Similar observations are made regarding the tower-top displacements. The observations imply that ignoring the soil effect may lead to misjudgement of the consequence of an emergency shutdown. The relative orientation of the ground motion with respect to the wind direction causes significant difference in the seismic behaviour of the wind turbine. This confirms that it is necessary to interchange the horizontal components of an earthquake in order to consider the intersectional effect between ground motion and wind.