"Having a pet is legal."
Translation:Το να έχεις ένα κατοικίδιο είναι νόμιμο.
Good question! "Το" in this sentence is considered as "[The fact] to have a pet is legal". It is just a way of saying something.
Many thanks Fotiosgaridis, is it an addition that is optional? Or do you have to include it when you want to make a general statement e.g. "Το να καπνίζεις είναι επικίνδυνο για την υγειά"?
Well it can be omitted but sounds more correct if you add it. Your example is 100℅ correct.
How is exactly is the verb formed here? να plus which form? έχεις looks like the 2nd person singular present tense? is it always like that? Thanks.
As you may know, Modern Greek doesn't have an infinitive that works the way that (say) an English infinitive does, so you have to use a personal form.
If you don't have a particular person in mind but are speaking generally, then as in English, often the second person singular is used (the way I did at the beginning of this paragraph -- "if you don't" wasn't speaking specifically to you, anna8691, but speaking about what people do in general).
Thus this has «το να έχεις» "the [fact] that you have...", with generic "you".
If a specific person is intended, you can also use that instead of the generic "you", e.g. «το να έχουμε ένα κατοικίδιο είναι νόμιμο» for "it's legal for us to have a pet".
Or, as in English, you can use the unspecific "one" -- το να έχει κανείς είναι νόμιμο "it's legal for one to have a pet". This uses the pronoun κανείς "one; someone" and the third person singular form of the verb.