Yes, Both of them take string, a pattern and replacement. The difference is, String will replace the string with "replacement string" if the pattern string exist in the input string.
Ex: String.replace("abc", "a", "A") - this will result in Abc. It will look for the search string "a" and replace the string with "A".
Whereas in Regex.Replace - here the search pattern will be considered as regular expression unlike string.
Ex: Regex.replace(~r/b/, "abc", "d") - This will result in "adc" . Here the pattern "b" will be considered as regular expression.
To make you clear, Regex.replace(~r/\d/ "A2B3C", "-"), this will result in A-B-C. Here the search pattern is \d - which mean any number. Regex will replace the numbers with "-" in the given string. Where as if you use the same search pattern for string String.replace("A2B3C", "d", "-") - this will result in "A2B3C". Nothing gets replaced.
Look at https://www.regular-expressions.info for more information about the regex patterns