Because the brain has no nerve endings inside of it, many patients who undergo brain surgery or neurological testing can be kept awake during the procedure. As long as you numb the scalp with a local anesthetic, the doctors and or scientists can poke around in your brain all they want without you feeling any pain.
This advantage also means that doctors and or scientists can ask you questions while they poke your brain. This is especially important during surgeries that remove brain tumors. By asking patients questions while they are being operated on, doctors can make sure they aren’t damaging important parts of the brain like the one for language (For example, if a doctor made a wrong move and the patient was unable to speak, the doctor would know something went wrong).
Going even further, scientists have implanted electrodes in the brains of surgery patients (with their consent of course) with the goal of stimulating deep areas of their brain. Applying specific electric or magnetic impulses to certain areas of the brain can have fascinating effects from alleviating severe depression to changing the way we answer moral questions.