To begin to address this question, we'll need a working definition of globalization. This is no easy task, and scholars across many disciplines have often struggled to adequately pin it down, but we can at least work with something along the lines of this: globalization is the process of the...
To begin to address this question, we'll need a working definition of globalization. This is no easy task, and scholars across many disciplines have often struggled to adequately pin it down, but we can at least work with something along the lines of this: globalization is the process of the integration or growing interconnection of peoples, cultures, and geopolitical structures on a globe-spanning scale. Many disciplines (including economics, anthropology, global public health, political science, and more) have developed keen theories and models to understand the immense complexities of this phenomenon, and your answer will change depending on what tools you use to analyze it. One observation common across all disciplines is that globalization has generally been an "integrative process," where the interconnections between subgroups of people have proliferated at an ever accelerating pace. Because our political units, economies, and systems of human governance are so much more intertwined than ever before, it is more difficult than ever to consider massive-scale warfare with another nation or group of nations that are pivotal to world systems (including the economy but also all other dimensions of human life).
Of course, if want to understand whether globalization is influencing the world to be more or less peaceful, we should ask ourselves: how would we understand or measure the relative level of peace and conflict? For instance, if we think of the last two hundred years of globalization, we have witnessed some of the largest and bloodiest periods of conflict, with previously unimaginable levels of bloodshed (see the Napoleonic Wars, both World Wars, colonial wars fought by European nations, the Taiping Rebellion). Does that mean that overall suffering and death has reached new heights with increased globalization? At the same time, however, there is strong data that shows that the overall frequency of armed conflicts and overall number of war deaths has decreased since World War II (cited below). So, there is reason to suspect that the further along the process of global integration is, the less likely it is that total, all-ought conflicts will erupt, because eventually the consequences and costs will be so tremendous and horrific that they are essentially suicidal. This isn't to say we are close to true, lasting peace and security. After all, even though major conflicts have decreased, there is still widespread violence, international warfare, and civil warfare occurring throughout the world, and much of this is in direct response to the complex forces of globalization.
This leaves us with your final question of whether these forces can be directed for a desirable outcome. An example of this could be identified on a large scale in the example of the European Union. Briefly, in the aftermath of World War II, the nations of Western Europe embarked on a several-decades–long process of political and economic integration that led to an enduring and successful peace between nations that had previously been embroiled in near endless war for centuries. These were nations that spoke different languages and had wildly different systems and cultures but nonetheless recognized that the path forward involved compromise and political union, while maintaining varying degrees of autonomy and sovereignty. While this was definitely not a perfect process, it at least shows a modern example of formulating an international system that led to the "desirable" outcome of diminishing inter-nation conflict and could give us clues about how to do so on a truly global scale. I hope this gives much to think about for this crucial topic, and best of luck contemplating this insightful question.