Boron dopants in metal-oxide-semiconductor field-effect transistors exhibit very peculiar behavior such as transient enhanced diffusion, clustering, and segregation. Especially, B segregation to the Si/SiO2 interface significantly affects the dopant distribution and thereby the device performance. However, there is a lack of studies on the mechanism for B segregation and diffusion in the Si/SiO2 interface. In this work, we perform first-principles density-functional calculations to understand how B dopants diffuse and segregate to SiO2. We generate two Si/SiO2 interface structures, in which crystalline alpha-quartz and amorphous SiO2 are placed on Si. Among various B configurations, we find that an interstitial B is energetically more favorable in the oxide, compared with a subsitutional B and a self-interstitial-B complex in Si. We examine the effect of point defects such as a floating bond and an oxygen vacancy in SiO2 on B segregation and also investigate B diffusion pathways across the Si/SiO2 interface.