Yes, PLEASE!!! If you're reading a nonfiction book (that you own, obviously), the whole idea of "don't write in the book" is complete bullshit. Consider the book a somewhere-between-$20-and-$200 replacement for a college course. The college course is a consumable. The book, then, also, is a (very cheap, in comparison) consumable.
If you can improve your retention of something that can be reasonably compared to a college course by 20-100% by writing in a book I'd argue it's disrespectful to your time investment to NOT do that. Write in the goddamn book. If it makes you feel THAT bad, then buy a second copy, find a way to donate useful books to people who can't afford them (consider a subreddit for your local college/community college) and do that.
The buried lede here is that if you're reading nonfiction that can't be compared to a college course, it may not be worth your time in the first place :)