$main and $current_category are both variables.
$main is a variable that is used to tell the internal workings what page to load. When $main eq "catalog" it is either loading the main page, or a category.
When loading a category, the $current_category variable is populated.
So the code I provided loads when the catalog section is loaded (main or category page) and when the $current_category variable is empty (so we know we are on the main page and not a category page).
Yes you can write the opposite, whether or not it will do what you want depends on what you want to accomplish
