A man was shot dead outside a police station in Barcelona, prompting an investigation by law enforcement.