If you use Bookmark+ then it just works, out of the box.
Vanilla Emacs doesn't bookmark nonfile buffers unless the context (e.g. the major mode) specifically defines a way to do so. It does that for Info buffers (nodes in manuals), for example.
You can do that yourself, for any given mode, so you can bookmark nonfile buffers without using Bookmark+. See file
info.el for an example of how to do that - search for "bookmark". It defines function
Info-bookmark-make-record, to create an Info bookmark, and it sets variable
bookmark-make-record-function to that function buffer-locally:
(setq-local bookmark-make-record-function #'Info-bookmark-make-record)
It defines command
Info-bookmark-jump, to jump to such a bookmark.