As mentioned, you can perform overhead dumbbell shrugs with a barbell, though the traditional movement will be more difficult as the weight will be slightly in front of your hips rather than in line with them. This means your spine won't be completely neutral when you're performing the exercise, thus reducing its benefits and risking injury.