Yes in the sense that if you provide enough detail for the specific instruction set then yes. If you say x86 for example, then of course no, as with most instruction sets, it evolved over time so instructions were added or perhaps changed over time. ARM certainly the same, ARM provides more architecture information to know what spec to refer to. Today perhaps if you say something like arm64 you might survive, but one expects that at some point in the future that will not be true. Already from fuz's answer "Your Apple M1 processor has the ARMv8.4-A" aarch64 started with ARMv8-A ARMv8.4-A is a different ISA. Now it may happen to share the same "instructions" but the variation is in the "architecture" side, I do not know the 64 bit side of arm like other arm variants. ARM and x86 you can usually build a binary that works across a number of targets since there is a lot of reverse compatibility, but obviously not every ARM will run "ARM" code likewise x86 and x86.
8051 and some others (6502 I think, maybe z80 maybe not, but not PIC, probably msp430) for various reasons are fixed from an instruction set perspective although...after intel stopped making them the 8051 evolved, and actually there are, forget the name, special registers that are very much not compatible from one 8051 to another. 8051s are still in use today, this web page passed through, well next to, vary many of them between you and me. The instructions may be compatible, but other parts of the implementation are not, and the whole thing needs to match to run "code" between them.
What language you use be it a high level compiled down eventually to machine code or starting at assembly language down to machine code. Is only part of the "run on all arm cpus" equation. Particuarly with ARM. The instruction set is just like the alphabet or the language. You can write a math text book in english or in spanish or russian, etc. And still have the same content and message and usefulness. It is the same book, just a different language and alphabet. Likewise you can write a biology book in english and it can be completely useless to a math class. The vast majority of the code has nothing to do with the processor core itself, it has to do with things outside the core, part of the system. Peripherals, operating system, etc. And those are not compatible from an mobile phone to a mac m1 to a raspberry pi. So while you could use the exact same instruction set from the same arm specification, the code produced can be completely incompatible with arm BASED processors with the same architecture and will not "run" on those arm processors, it will crash.