The files may be selected using two methods: the patterns may be specified consecutively or successively.
First method
This method requires to use a Bash extended pattern to specify several patterns together. The user must enable the extglob shell option using the shopt builtin (c.f. shopt builtin) because the Bash extended patterns are not enabled by default.
prompt% scp username@hostname:"/home/user/dirname/@(foo|bar)*" .
The Bash sub-pattern @(PATTERN-LIST) allows to specify a list of one or more patterns separated by |. It matches one of the given patterns. For example, @(foo|bar) matches foo or bar but does not match foobar, barfoo, foofoo, barbar.
The glob star matches any string of characters, including the empty string. Therefore, the pattern @(foo|bar)* matches all filenames that start with foo or bar (prefix (sub)string).
This method works when the remote shell is Bash and its extglob shell option is enabled. The user may enable this Bash option in its configuration file (e.g. ~/.bash_profile), on the remote machine.
Second method
This method executes the same command with different arguments, several times. It works using a POSIX compliant shell.
for prefix in foo bar
do
scp username@hostname:"/home/user/dirname/${prefix}*" .
done
Brace expansion
This method is not robust because the resulting expression may specify filenames that do not exist.