Whether you can trace or not depends more on ownership than anything else.
If you took the picture yourself? You can trace it. Example: If I'm struggling with a hand, I would often just take a picture of my own and trace over it for my comic. After enough times, it actually taught me a lot about their structure and I don't do it as much anymore.
Now, if the content of the photo itself is owned by someone else (a model, cosplay, or an art piece) you have to still get their permission to trace it. Same goes for photos that you didn't take. I recommend either taking your own photos or seeking out stock photos with a creative commons license (though you may still have to credit them in your post).
Any time you trace without asking permission and crediting the owner, it is theft. If you want to do it for your own practice and never post it anywhere, that's one thing, but don't use something that's not yours to get attention or money.
From an artistic stand point, you definitely shouldn't rely on tracing, even if you do own the asset--tracing a body part, cool. Tracing a background element/prop, cool. Referencing, cool. Making a hodpodge of different references for one piece, awesome! Just don't rely on it like a crutch, otherwise it'll stunt your progress.