As you may know, it is a Jewish custom to treat books, especially sacred books like the Hebrew Bible, with great respect. If a Hebrew Bible, prayer book, or another book of sacred text falls on the ground, it is a custom to pick the book up and then kiss it. Similarly, many Jews will kiss a sacred book after using it and before returning to the book rack or shelf. Holy books that have been damaged beyond use are buried in a cemetery.
The answer to your question depends on the motivation for writing in the margins. If you are writing in the book to further your learning and spiritual exploration, e.g. to help you recall a thought or particular passage, that would be fine. Writing that desecrates the book would not be permitted. In other words: notes are OK, but doodles are probably not.
If, however, you ultimately feel uncomfortable making notes in the margins of Bibles, prayer books, and other sacred texts, sticky notes can be a good solution.