If your shell is bash, you can try:
exec 3>&2 2>firefoxFile; firefox & exec 2>&3-
It's your shell (eg. bash) which prints that
[jobnum] pid background job notification to stderr, not firefox. This kludge temporarily redirects the stderr to the
firefoxFile file, capturing into it that notification and whatever firefox will write to stderr during its lifetime.
It will NOT capture the
[jobnum] Done firefox bash will print when the background job has terminated.
firefox & > file will be parsed as two commands 1.
firefox & (which will run
firefox in the background) and 2.
> file (which will truncate
file without writing anything to it). That's most certainly not what you intended.
 you can read here why this trick doesn't work in other shells; while it's possible to redirect the stderr in
zsh does not write its prompts and job notifications to stderr, but to another fd pointing to the current terminal, opened especially for this purpose.