Nowadays sexual violence among adolescents continues to be detected in schools. In this sense, several studies show the great importance of the interactions of boys and girls with people in their educational environment to configure their emotional and sexual identity, their beliefs about violence, and their relationship with sexual violence, being necessary to identify the actions that prevent sexual violence at schools. In the current article, and according to the literature review, a model based on structural equations is proposed to analyze the influence of students’ relationships with one another, with the educational community (at the center, with faculty, staff, other workers), and families’ relationships with the center as well as adolescents’ own beliefs related to gender violence on being a victim, bystander, or aggressor of behaviors related to sexual violence in a sample of 4,273 Spanish students in secondary education. This model is replicated for only women ( n = 2,022) and only men ( n = 2,038). The results show that positive relationships are a protective factor against involvement in situations of sexual aggression, and they influence the acquisition of transformative beliefs regarding models of attraction and nonviolence. In turn, these beliefs even more obviously affect the prevention of this type of violence.