If we are talking about OneNote 2016 that comes with MS Office (not the app for Windows 10 that is just called "OneNote", then yes.
The option to work offline is deeply hidden in the OneNote 2016 user interface: right-click on a notebook name, select "Notebook Sync Status" from the context menu and then turn "Sync manually" on or off. You can also add this command to the Quick Access Toolbar or to the ribbon. To find the command in the OneNote options for editing these menus, you need to set the command filter to "All Commands". In the alphabetic command list, search for "Work Offline", and add it to the menu.
If you select the Quick Access Toolbar to add this command, you'll notice that the command name "Work offline" will appear as text on the menu. To the left of the command name an active checkbox is displayed that allows you to enable and disable the feature.
If, on the other hand, you add Work offline to the ribbon, then this command behaves slightly differently: the background color of the command button is colorized (or grey) when the feature is enabled (= OneNote is offline).
Working Offline in this case means that any changes to your notes won't be synchronized to the original notebook on OneDrive or OneDrive for business until you turn the offline switch off again. Until that point the notes are somewhat "fragile". Don't try to close an not yet synchronized notebook (should not work anyway, but emphasize "should") as this will erase the local cache where your actual changes are stored.
There is a second option, which may be more interesting because your exam restriction cannot be that easily outmaneuvered:
With OneNote 2016 for MS Office you have the option to create notebooks on your local drive instead of a cloud storage. Maybe you want to do this, copy all of your working notes (from inside OneNote) from the cloud notebook to that local notebook. During the exam you'd keep the cloud based notebooks closed and just use the local one.