Can we do autonomous flight by using only Optical Flow Kit

If I use optical flow Kit with px4 firmware on pixhawk then can I do autonomous takeoff, autonomous waypoint navigation indoors without GPS?

If yes then how do I enable the autonomous feature. I have installed optical flow kit. But it does not go in auto takeoff / position control mode.

Yes you can, but it is not out-of-the-box like GPS autonomous flight, you have to start with
You have also to calibrate the lens, and sensor. See Arducopter doc for information (It is not the same as you are using PX4 but it may help to understand)