I have Spain Schengen Visa, the validity of which has not expired yet. Can I still apply for a Visa to Portugal?

If you are already holding a valid Spain Schengen Visa, then your application for a new Visa to Portugal will not be accepted. You can apply after your current visa expires.