Steps to follow to Intercept Localhost Traffic with Burp Suite Mozilla Firefox:

Go to Mozilla and type about:config
Accept the risk and continue.
Now, search network.proxy.allow_hijacking_localhost and set the value from false to true
Send request from the localhost, it will start intercepting

OR

Open the hosts file (you need admin privilege) and add an entry like this

127.0.0.1 example.com
It means example.com points to IP address 127.0.0.1

Now you can access the localhost application through any browser using example.com and Burp Suite will successfully intercept the request.