I assume this is for PC through Steam.
The answer is yes, you can play Portal 2 offline.
Here is the support answer with instructions on how to launch Steam in offline mode:
https://support.steampowered.com/kb_article.php?ref=3160-AGCB-2555