I don't think modern OSes will allow any user space application to access any hardware directly. Any hardware access must be performed through system calls(low level e.g. asm), which often encapsulated into function calls(higher level).
But beside normal user space application, Nim can produce kernel space program or device driver that can access hardware directly. Nim also can produce a program that will be put in an embedded system. In such environment, usually there is no OS or only primitive OS, and Nim produced program have higher chances to access hardware direcly.