It is OK to talk to them. Just don't lie and don't answer questions. Doing either could land you in jail.
Even if it's completely entirely true and they believe it and they like you and that's enough for me. It can only hurt you.
And yeah, I know, it may not always be obvious whether they are investigating you, especially if they are willing to lie or be deceptive. (If they're really investigating you, you may not even realize that you're talking to cops.) On the other hand, it might be clear enough sometimes that they are not for me to be willing to talk to them.