I started as Dutch, and while the Dutch are at war with the Spanish, I can raid Spanish ports. Now I'd like to become Spanish so I can raid Dutch ports. Is this possible?
Yes, you are a freebooter and can do whatever the hell you like.
Simply start attacking dutch ships, this will increase your reputation with the spanish, while reducing it with the dutch.
Once the durch are hostile to you, you can initiate a raid from the sea.
However, you are able to land a shore party and march into town, which always allows you to trigger a raid, no matter your relation with the dutch.