By default you are already at war with everyone else in the galaxy. What you’ve read just concerns formal alliances, and is a little dated.
Currently with the formal alliance mechanics, if memory serves me correction, you and your allies can garrison ships on each others stars without them being owned by the other. So, for example, if you have 200 ships on your allies star they are still your 200 ships that can be moved and controlled solely by you.
This mechanic is always in effect while you are allied. Once you break the alliance, the whole galaxy gets notice, and the alliance mechanics are still in effect UNTIL the 24 hour mark. After the 24 hours, any former allied ships garrisoned on the star attacks the stars owners garrisoned ships.