I'd think that if the reason to use a dash or underscore is ease of typing, dash would win out since it doesn't require pressing shift in common layouts. Otherwise I don't know of a significant convention for one over the other. Alternatively, the format used for filenames could be configurable; this would seem a decent compromise and assist if users want to ensure consistency between different programs that generate temporary files.
I'd think that if the reason to use a dash or underscore is ease of typing, dash would win out since it doesn't require pressing shift in common layouts. Otherwise I don't know of a significant convention for one over the other. Alternatively, the format used for filenames could be configurable; this would seem a decent compromise and assist if users want to ensure consistency between different programs that generate temporary files.