Yes, it should be no problem. Just use teflon tape on the threads to seal it.
I would worry though if you can't get the plug out, that the threads in the pipe won't be any good (or you'll destroy them in the process of attempting to get the plug out). If that happens, you'll need to re-thread the pipe. You should be able to rent a tool for this at your local tool rental place.
You don't mention what the pipe is, so just be prepared that you may not be able to use it until it's repaired, if you do have a problem with the threads.
The issues with the compression fitting have been addressed.
The brass flange fitting, the rubber gasket, and the threaded pipe is the "toilet spud". Replacements are available if the rubber is perished or the metal parts somehow damaged.
The flange nut looks pretty well bonded to the threaded portion. Soak well with WD-40 and let it soak in. There are splines inside the spud on which one would apply an internal spud wrench to keep the threaded pipe part from turning. You may find some other chunk of metal that will wedge against the splines, which in turn can be held by a conventional wrench. Holding the spud in place, remove the flange nut with a suitable tool.
Once the flange nut is removed, push the threaded pipe part inwards, but ensure it will not fall into the toilet. The part inside the toilet is conical shaped. Pushing it inwards will give enough free play that the rubber gasket can be pulled out. Once the rubber is out, there will be enough clearance in the toilet hole that the threaded pipe part can now be removed.
Examine the parts and evaluate if replacement is necessary. If the rubber is not too far gone, it may be possible to clean it, treat it with some sort of rubber treatment, and reinstall. If the rubber is cracked, hardened, rotted, or brittle, it will need to be replaced. The nut should be tightened firmly enough to ensure the rubber seals well against the toilet, but not so tight the rubber gets pushed out of position or the toilet gets cracked or broken.
Best Answer
It is likely that the "putty" you see is actually pipe thread compound, or pipe dope, which is appropriate for most threaded pipe fittings. You should be able to use an adequately sized pipe wrench to unthread the plug without too much difficulty.
NOTE- there is a chance that someone used the wrong compound, as many are not approved for use on plastic pipe because the solvents in the compound can soften and damage the plastic. There is also a chance that someone used some other stuff (hopefully not glue). The only way to find out is to try to remove the plug.
Consider removing the compound and using teflon thread tape when you reassemble the fitting, or ensure any compound you use is approved for use on that plastic pipe (looks like PVC).