If it's carrier-locked, you can certainly sell it, but it carries less value as a carrier-unlocked device is more versatile as it has a wider audience looking at it. Also - it's easier for YOU to get it carrier-unlocked than it would be for any purchaser.
Locked to a Google account is a whole other story. If you sell it that way it is technically a brick, the purchaser won't be able to set it up for themselves. Most selling sites won't even allow you to sell one in this condition. Additionally - if you can't properly sign out of the account before selling it, it can be assumed that you're selling a stolen device. Properly resetting the device so that it is not locked to a Google account is simple but often forgotten.