Find all files (type f) with any name (iname '*.*') and execute the command to replace any character that is not a letter, number, period, or underscore with an underscore (rename 's/[^a-zA-Z0-9._]/_/g' {} \;).
find . -type f -iname '*.*' -exec rename 's/[^a-zA-Z0-9._]/_/g' {} \;