Ok, if oil on canvas, you won't harm it if as a first resort you use a lint-free cloth and a very weak solution of washinbg up liquid. Moisten a corner of the cloth, wring it out and gently dab and wipe at an inconspicuous corner - see what muck comes off and see what effect it has on the painitng. If it seems to do some good, use clean water and a clean cloth to rinse off, and procedd in this way across the picture.
If you suspect at any point that you have an old master or a collectable, stop and consult a valuer!