No. Neither through masturbation, neither through anal penetration, nor through vaginal frictions. Vaginal penetration is necessary for a pregnancy to take place. "And without ejaculation?" There are different opinions about the presence of sperm into the pre-seminal fluid, still the famous "pull-out method" is responsible for several unwanted pregnancies. Thus, if penetration takes place, there's no contraceptive efficacy.
Suggested for you: How Does Natural Pregnancy Occur?.