This is very much the sort of megapixel-folly that beginners think about. Rather like believing a faster car is a better car. Let's try get you out of that mindset.
I have nikon d3300. it have 24.2 mega pixel sensor but some where i read that kit lens have only 12 mega pixel effective but the actual resolution of image is 24MP.
The modern kit lens is capable of as practically the same resolution of detail as the best lenses, and any differences are small, generally too small to be noticeable when viewing the image in any sensible way ( i.e. not zooming in at a ludicrous magnification of the image ).
A very common beginner belief is that you can buy better lenses, camera or whatever to make your images better. Not really.
If your composition, use of light, framing and technique are not producing great images with a kit lens and a basic DSLR, then the problem is not the equipment.
The number of pixels is a not a measure of quality. People used to use 6Mp DSLRs for the front pages of major magazines, and the quality of those images far exceeded what most people shoot with 24Mp ( or the even more ludicrous 50Mp models that have appeared ).
Don't worry about pixels.
I have never, ever had or heard of anyone looking at a print or image and saying not enough pixels. I've heard them like or dislike or not care about an image, based on it's emotional content, style, colour, composition and even the frame it was in, but not based on it's pixel count.
what is blocking the camera sensor to take up to 12MP photo only?
The biggest "block" to stopping you getting the most out of your lenses and camera is almost certainly not the lens. It's you.
Want dazzling images that wow people ? Learn composition, lighting, exposure principles, framing. Learn to concentrate on the image as a whole not the pixels. Great pixels never made a great image.
what lens should i use to take full advantage of 24.2 mega pixels?
The one on your camera.
Never worry about the lens. Worry about your technique.
Better technique, better images.
Better pixels ? Practically useless.
But if you really, really, really can't get over pixels then guess what gets you the best resolution from your camera ?
Better technique ?
Technique, technique, technique.
Learn it. The more you learn, the better everything gets.
And maybe, just maybe, you'll forget about pixels.