At the beginning of a combat, all participants roll initiative (d20 + Dex). Everyone ends up with a number, and take their turns from highest to lowest. Initiative count 20 (losing all ties) means that lair actions happen after any creature whose total for the initiative roll was 20, and before any creature whose initiative roll was 19.
So, for example, a combat starts.
Bob the Fighter: Dex 20, Dex mod +5, rolls 16 for initiative. His initiative count is 21.
Jim the Rogue: Dex 16, Dex mod +3, rolls 17 for initiative. His initiative count is 20.
Tom the Wizard: Dex 14, Dex mod +2, rolls 17 for initiative. His initiative count is 19.
Ginormous the Ancient Red Dragon: Dex 10, Dex mod +0, rolls 16 for initiative. His initiative count is 16.
Bob's turn happens first, followed by Jim's. Then Ginormous can use his lair action. Then Tom takes his turn, and finally Ginormous takes his.
In D&D 3.5, No
The basilisk (Monster Manual 23-4) is not otherwise noted as not being immune to the petrifying gaze attacks of others of its kind, so a basilisk is immune to the petrifying gaze attacks of others of its kind as well as its own petrifying gaze. That is, the Monster Manual Glossary on gaze says, "A creature is immune to gaze attacks of others of its kind unless otherwise noted" (310), and the Dungeon Master's Guide Glossary adds, "A creature is immune to its own gaze attack" (294).1
In Pathfinder, also No
The description of the universal monster ability gaze attack mirrors that of the Monster Manual for Dungeons and Dragons 3.5. That game's basilisk is likewise not called out as specifically vulnerable to other basilisks' gazes.
Avoiding and getting a stony gaze (or fist)
Immunity to petrification is difficult to acquire in Dungeons and Dragons 3.5; in core that's usually a special quality of the angels (MM 10-13) and eladrins (MM 93-5), for example. Changing form so as to gain such a creature's traits is likely the easiest way to gain such an immunity. Immunity to petrification in Pathfinder is easily acquired for 8,000 gp from the on-the-nose-named amulet of proof against petrification.
The eyes of petrification (DMG 256) (98,000 gp; 0 lbs.) are a magic item in Dungeons and Dragons 3.5 yet not Pathfinder, but, by way of consolation, Pathfinder's feat Cockatrice Strike lets a warrior's attack turn foes into statues.
Neither magic item mentions basilisk eyes as necessary for their construction.
1 While the Monster Manual Glossary on gaze (MM 309-10) recommends a creature effectively turn off its gaze attack by (I kid you not, basilisk fans) wearing a veil, the Dungeon Master's Guide on gaze attacks says that a creature with a gaze attack can turn it off and on (294). However, the 3.5 revision paid the DMG Glossary only scant attention (for example, the spell resistance entry refers to the power word spells as spells of the school of conjuration rather than enchantment), and the Monster Manual is, after all, the game's primary source for monsters, so a DM may reasonably rule that the Monster Manual's correct in having a basilisk lack an on/off switch for its petrifying gaze.
Best Answer
5e
The Monster Manual tell us that basilisks live in arid, tropical, and temperate climates, and seek sheltered lairs such as caves, often living underground.
Basilisks move slowly ("ponderous" predators) and can consume prey they have petrified with their strong jaws.
And that's about it.
"The Ecology of the Basilisk," Ed Greenwood, Dragon 81
The next best--and only other--reference I know is this article (January, 1984, predicated on 1e lore*) which tells us:
(among many other interesting tidbits)
Pulling it together.
I think of basilisks more like cacti than like lions. They've got their space and no-one except silly adventurers and crazy mages bothers them. They'll ruin your day/life if you get too close, so other animals just don't get close. Thus a basilisk lair would be typified by a sparseness of "normal" fauna.
Their petrification gaze functions both as a strong defense and as a hunting aid. Beyond this, whether they still hunt small game and feed on carrion or they ambush large game (including humanoids) and consume their petrified forms at their leisure... is up to you.
* - 5e's most-closely related to 2e both by design and in my evaluation. However, the 2e Monstrous Manual does not contain an "ecology" section for the Basilisk, leaving this 1e contribution a little less-well related to your 5e uses, but still (IMO) the best canonical reference.
2e MM does tell us that a basilisk lives in "any land", is a carnivore, and moves slowly. That's about it, though, for these purposes.