Yes. In bash (and other shells), a command that exits with status 0 is considered "success", and any other exit status is considered "failure".
The bash if command doesn't strictly work with a "conditional" expression. The syntax is:
$ help if
if: if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi
Execute commands based on conditional.
The `if COMMANDS' list is executed. If its exit status is zero, then the
`then COMMANDS' list is executed. Otherwise ...
It branches based on the exit status of the COMMANDS it's given.
The typical commands you see most commonly in an if statement are the [ builtin command and the [[...]] construct. These commands work just the same way: exit with status 0 for "success/true" or non-zero for "failure/false" and, like cmp or any other command, can be used just as well inside or outside if/while/until statements.