Hello,
There used to be a glitch that allows you to do so. First, choose cavalry division with your desired secondary (the BAR, for example). Once chosen, switch your division. This will keep the BAR as your secondary and allow you to put an attachment on it (a red dot sight for example). Once you choose that attachment, switch the division back to cavalry. Done. You won’t be able to see that you have the red dot, but it will be there when you enter a match.
Unfortunately , it was patched a year ago and since everything is server based in the game u cant modify the class to give attachement unless u hack into their server .
Hope i was helpful to ur request thank you