It depends. If you are in a courtroom, typically recording will be prohibited. If you are having a conversation where there is an expectation of privacy, most likely you cannot legally make the recording. If you are in a public place talking with someone, and there is no expectation of privacy, it may not be considered illegal. It all depends on the specific circumstances.
Answers to questions on this forum do not create an attorney-client relationship.