Absolutely. And it is extremely useful to do that.
M-x flush-lines and
M-x keep-lines are your friends, as well as just
(The first thing you need to do is of course
C-x C-q, to make the buffer writable.)
If you use library Grep+ (
grep+.el) then you have these commands, which remove comment lines and toggle such removal:
grepp-toggle-comments, which are bound in grep buffers to
(Grep+ also gives you commands that make it easy to have multiple grep buffers:
There are also other buffers that are read-only by default and which it can sometimes be useful to use
C-x C-q and then edit them, in particular (IMHO),
M-x list-colors-display). Info used to even have a command that lets you edit the current node.
Unfortunately (IMHO), Emacs has generally moved away from such use, making it harder. For example,
*Messages* buffers now defined keys in their respective modes, which means that to edit them normally you need to either (1) change to another mode or (2) use
C-q to be able to insert certain characters.