If you go down to assembler level and basic CPU instructions, what is a function? A function is just some block of code that is surrounded by JMP (jump) instructions. So, instruction pointer (instruction that is currently executed) jumps from some other place in program to the start of a function, executes it's code, and then jumps somewhere else.
In this sense, a loop is definitely a function. Only slight difference is that it usually jumps to it's own beginning to check some condition and execute itself again, instead of jumping to some other place (usually place of its call).