Every browser has its own specific driver executable (geckodriver for Firefox, chromedriver for Chrome, msedgedriver for Edge) because every browser is built on a different engine (Blink for Chrome, Gecko for Firefox, WebKit for Safari). These drivers implement the W3C WebDriver Protocol and communicate with the browser's automation capabilities. The driver version must be compatible with the installed browser version.
Each browser is like a different car model. You need the specific key and ignition system for each car. You can't use a Toyota key to start a Honda.
Your script works perfectly on Chrome but fails to even start on Firefox. What is the first thing you check?