1. ¿Es España un país seguro? ¿Es "insert neighborhood's name" un barrio seguro? ¿O es un barrio chungo (this world is slang, but this way everybody will understand what you mean)
2. Comparado con otros países, el índice de criminalidad en Japón es bajo, especialmente en casos de asesinato.
And to answer your questions, I would say Spain is pretty safe. It is better not go out alone at night (especially if you're a girl) but just like in every big city. However, there are bad neighborhoods in every city, so just make sure you check the area where you're going.