you would have to have body fluids enter into the blood stream..If the hangnail is bleeding or open and comes in contact with blood semen.It possible but probably a fairly small chance ,do you know one of you is HIV positive or are you just worried .anybody having unprotected sex should be tested periodically anyway,How open was the hangnail? If you have a bleeding nail and it comes in contact with infected semen I would probably get checked to be safe also watch for HepC.
I would say no. I'm a frequent visitor to the HIV prevention forum, and mutual masturbation is never a way for HIV to be transmitted, whether there is blood or not. If you still have doubts, post your question on the HIV prevention forum, and you will get back the same results.
Theoretically yes, if the hangnail was open and actively bleeding. The virus is found in semen, pre-semen, vaginal fluid and blood. The body is generally good at sealing off small cuts fairly quickly. It is very unlikely that HIV would be transmitted this way, however it would be best to follow up with your Dr. or nearest STD clinic.