The short answer is that you are allowed to do so but my advice is that you do not. The Divorce Petition is not a public document. It does not hang on the wall of the County Court for all to see and neither can just anybody ask the Court for a copy.
The petition is only seen by the Judge, yourself, your wife/husband and any legal advisors so you will not really be “naming and shaming” the other person.
The other person would be served with a copy (by post at their home address) and they are asked to complete a form sent with it.
However to name the other person could incur additional costs as your Solicitor may need to chase them for a response. You may need to pay a Process Server to serve them again and potentially they could instruct a Solicitor and start to correspond with your Solicitor thus increasing your legal fees.
This could also delay matters, as they need to return their form to Court as will your husband/wife in order that you can proceed with the divorce.
You are allowed simply to say that your wife/husband has committed adultery with “an unknown man/woman” or with a “woman/man whom (you) do not wish to name”. This is usually the best route.