I have an in floor outlet (under a rug) and I don't want the plug sticking up under the rug. Can I cut off the plug of an extension cord and directly wire it in with the wires of the outlet? Thanks in advance for your reply
No, you can't.
An extension cord is designed for temporary use. Many of us (myself included) will use an extension cord on a "semi-permanent" basis.
But it is quite different to have an exposed extension cord and a hidden extension cord. An extension cord is not designed - or rated & tested - for use in a hidden location. Use in that matter raises the very real possibility of damage to the cord from repeated walking on the carpet going unnoticed until it is too late (e.g., fire). Wires are also rated based on temperature, and a cord that is rated for a particular temperature based on being in open air may not be safe when used under a carpet, where it may heat up quite a bit more - also increasing fire risk.
The proper way to use a floor outlet is to have a cutout in the carpet around the outlet, and ideally a cover on the outlet when it is not in use to avoid dirt (or even worse, spilled drinks) getting into the outlet. I see that type of outlet in hotels & conference rooms and it is a little ugly but functional and safe.
If you are not going to use the floor outlet at all, covering it with a movable rug is OK. But you should never cover an outlet or junction box of any type (e.g., including if you removed the outlet, capped the wires and put on a blank plate) with any permanent flooring like wall-to-wall carpet. All electrical connections (with very few exceptions) need to be easily accessible.
That's not how you use those outlets
Those outlets are for putting a desk above them, and now you have power to the desk. I gather you've changed the usage of that room and now it is open space that is traversed by people, or you have a rug that can't fit without overlapping that floor outlet. Well, then, you don't use the floor outlet.
It is illegal to use extension cords (cordage) as a substitute for the permanent wiring of a building. I once saw a hefty 6/2 cord going to a powdercoat oven, drywalled right into the wall. On my next visit a few months later, there was EMT conduit and a receptacle there instead. Fire marshal had been by, I guess.
Running extension cord under carpet is a bad idea for so many reasons, as manassehkatz discusses. They do make special under-carpet cable, you might try researching that, but how you terminate that cable at the floor box will still be a major safety issue.
What's at stake here is the fire inspector finding the bad installation In the ashes (it's what they do), and declining your fire insurance, leaving you on the hook for the mortgage when they call it. (Even a non-recourse loan becomes recourse at that point, and worse, it can't be cleared in bankruptcy, nor can civil liability for injuries). The penalty is rare but harsh. Speaking of rare but harsh, manslaughter charges are also possible.
The right thing is to install additional wall outlets, or other floor outlets, where you actually do need them... Or if appropriate, hang a pendant from the ceiling. -Although if your building is built to recent Code, it will already have wall outlets strategically placed so any appliance with a 6' (2m) cord that's along a wall can reach an outlet with its own cord.
I hardly need to tell you how to plug more than 2 things into a receptacle.
Edit: I just realized that the entire thing is flammable. The only reason I'm not deleting it is it might inspire a good idea.
One thing you could do is raise the rug using a platform made out of wood — a few 1x4s should be enough — with space cut out of it for the extension cord to take pressure off of it, then use a flat plug extension cord: