Ohhhh yeah. The number one rule of CQB is to not, but if you have to- frag out.
My best advice with spawn rushing is to get off the X ASAP. That's the first thing I do whenever I spawn, is get off of where I have spawned and get to a secure location.
Make sure to watch your litter trail so that no one knows you were there, and once you get far enough away that people are going to assume no one spawned there, then go ahead with your given mission.
Combat is grueling and often unfair, so we have to anticipate what our enemy is going to do and counter it. It's just like that initial engagement that I talked about- If they are going to spawn rush you, you can use that to your advantage and catch them off-guard.
Let's say you spawned at Scaffolding (construction) on Matka, and you have players spawning near bridge. They are going to immediately rush to your position, likely through the back alley. Those players are going to expect you to engage them directly from your spawn point, or from the corner of the building by Bridge. If you wait for them to get to that alley from bridge to scaffolding, you can loop around and shoot them all in the back if you go out the front of scaffolding, and enter the alley from the direction they entered.
Initiate contact with your most casualty producing weapon, break contact, and then engage them when they come and try to clear that corner or follow the path that you followed 
Holy essay 
I'm yappin