score:13
In some countries between the wars there was a serious Civil-Defense movement. These were part-time civilian organisations aimed at supplementing ordinary firefighters and rescue workers in event of air raids. Britain also had an Auxiliary Fire Service
As of actual military firefighters they were most important for branches of military other than the army. The navies (especially the US Navy operating lot of aircraft carriers in WW2) took it very seriously, appointing damage control parties and training basically all sailors in firefighting. Look for example at this introduction or at this 1945 manual. Apparently, naval firefighters were not a separate unit, but "repair parties" had sailors in preorganized "firefighting groups".
Air bases also had dedicated firefighters. Planes during the WW2 often came in trailing smoke, leaking fuel or with damaged landing gear. Landing in such conditions regularly resulted in the plane bursting in flames. The RAF for example had a separate Fire Service Here are some of their fire trucks. USAAF/C Fire fighting platoons come close to satisfying your requirements, as they belonged to the Army, and moved with their advance (WW2 fighter planes had limited range, so there were many-many airfields in France and Italy at the end of the war.)
But were there actual army firefighters putting out fires in the frontline?
There is a book that might contain the answer, but it is not freely available online.
Yet it turns out that there were. US Army Fire Fighting platoons were mainly base-based (as you describe) but here I have found that some were deployed on Utah Beach on 13 Juny 1944. Judging from the comment that they had to dig in, and from this map and this page, there were almost certinaly in range of German field artillery, which I consider frontline enough for an unit equipped with unarmored trucks. As they needed heavy equipment and - especially important - stable sources of water, I do not think they were deployed closer than this, though more research would be needed.