Pretty sure it's to and from Germany and then within the country. The validity of the ticket is only during the tournament as well.
If you're wanting to nip in and out of other countries it might be you have to get an actual inter-rail pass, although I don't know how much more expensive that would be...
If you’re coming to Germany from abroad, the Interrail Pass EURO 2024 is just right for you. With this special offer, match ticket holders are entitled to a 25% discount on specific Interrail Passes.
The Interrail Pass EURO 2024 is valid for a round-trip journey from 32 European countries to Germany and within Germany. Get your discounted pass now and plan your EURO 2024 journey, experiencing Germany’s highlights and hidden gems along the way.
https://www.uefa.com/euro2024/event-guide/ticket-holders/