In this paper, we first develop a tractable mathematical model of the handoff (HO)-aware rate outage experienced by a typical connected and autonomous vehicle (CAV) in a given THz vehicular network. The derived model captures the impact of line-of-sight (LOS) Nakagami-m fading channels, interference, and molecular absorption effects. We first derive the statistics of the interference-plus-molecular absorption noise ratio and demonstrate that it can be approximated by Gamma distribution using Welch-Satterthwaite approximation. Then, we show that the distribution of signal-to-interference-plus-molecular absorption noise ratio (SINR) follows a generalized Beta prime distribution. Based on this, a closed-form HO-aware rate outage expression is derived. Finally, we formulate and solve a CAVs' traffic flow maximization problem to optimize the base-stations (BSs) density and speed of CAVs with collision avoidance, rate outage, and CAVs' minimum traffic flow constraint. The CAVs' traffic flow is modeled using Log-Normal distribution. Our numerical results validate the accuracy of the derived expressions using Monte-Carlo simulations and discuss useful insights related to optimal BS density and CAVs' speed as a function of crash intensity level, THz molecular absorption effects, minimum road-traffic flow and rate requirements, and maximum speed and rate outage limits.