It depends entirely on the circumstances. If for instance you have loads of leave to take, your branch is fully manned so you won't be missed and you are on a fairly low key deployment i.e. Ko Samui guard ship then yes... maybe, but even then you will probably have to pay for your own flights.
Under any other circumstances........that's a big fat negative shipmate.
The Executive Warrant Officer and Departmental Co-ordinators run a "traffic light" system with regards to allowing personnel to leave the ship whilst on deployment, according to the Ship's programme: if the Ship is conducting Operational Sea Training or a specific operation where the absence of specific personnel will have an effection of the capability of the unit, then that is a "Red" period (i.e. no chance of being landed). If the Ship is conducting operations/training that can allow the absence of some personnel then that is a "Yellow" period, and that person may be allowed home, depending on location/cost/circumstances. If the Ship is in reduced readiness or not conducting any training/operations - i.e. alongside in Base Port for some time - then that would be a "Green" period, and there would be little restrictions on the person being allowed home.
However... personnel are permitted to travel according to the circumstances; if someone needs to go home for professional training for which they are required to do as part of their job and is likely to affect the unit's Operational Capability, then they would take priority over someone who is going home for a sibling's wedding. Furthermore, leave is usually granted for compassionate reasons when the immediate family member is either dead/dying/at risk of serious illness or injury. Weddings would not necessarily apply under these circumstances. If it is a genuine Service or compassionate reason then the MOD would pay for the travel - if it is leave to attend a wedding, they may have to pay for the travel themselves (worth considering, depending on the Ship's location), and would have to relinquish the days spent travelling and stayig at home from their own Annual Leave Allowance. And they may also face the risk of being 'nominated' for duties during the leave period when the Ship returns to the UK, to allow those who remained on board throughout the deployment to go home to see their families.
My best advice is that you (or the person you are referring to in your post) should speak to the Divisional Officer/Departmental Co-ordinator as soon as possible and book the leave as necessary; but be prepared to be disappointed if the Ship's programme does not allow it, or someone with a higher priority is trying to get back to the UK at the same time...