this has been asked many times before.
The object files and "binary" files (exe, coff, elf, etc) are mostly machine code but generally not all machine code, there is usually some amount of information in the file to describe where to load the binary blobs as well as debug info like labels and such if you built that stuff in.
It is not completely possible to determine what language or compiler or assembler was used to create an executable or object for that matter. There may be some metadata in there to indicate this but that can be easily faked. With time and experience you may be able to pick out code sequences that are particular to a compiler or version of compiler, but that could also be someone hand coding or coincidence.
From high level language to binary there is information removed at each stage, from the original variable names to dead code elimination, optimizations, etc. So you can really not get back to what you started with if your interest is decompiling, it is a lossy process.
Now some languages binaries are not machine code for the target but some next level of interpretation, java for example, or a JIT compilers binary format, which later, runtime, is interpreted or compiled and assembled into native machine code. Even in those cases though there usually will want to be a file format that is not all machine code.
For work where you are dealing with processor booting, like microcontrollers or the boot flash on a pc or something like that where you need the prom image sometimes a pure binary file is created either because that is what a bootloader needs or a prom programmer tool needs, although over time bootloaders and prom programmers are starting to accept other file formats.