Only a variable name can be in the first position of this parameter expansion. Thus, you must assign your string to a variable before running a substitution on it.
#!/usr/bin/env bash
# ^^^^- this makes your script a bash script
# for extra paranoia, one can add an explicit version check
# otherwise, a user running 'sh yourscript' can override the shebang above
case $BASH_VERSION in '') echo "This script requires bash" >&2; exit 1;; esac
dev=/mnt/raid1
var=${dev//'/'/}
echo "Variable name corresponding to $dev is $var"
Note that this is an extension not guaranteed by the POSIX sh standard. It is thus unsafe to use in any script with a #!/bin/sh shebang (which only guarantees functionality required by that standard).
${var//find/subst}at all.eval, and there's a lot of security impact when it's used carelessly; whereas bash gives you indirect references so you can use "variable variables" safely).