I know the modes from Ionian to Locrian, and I know 1-4-5(major) rule. My question is how can you apply diminished or dominant 7th chords in these modes. Shall I apply 1-4-5 all being major 7th chords or diminished chords? Are there any other way? Besides that are there any more rules rather than playing the 1-4-5s in major and the rest in minor ?
You need to understand why constructing triads on different scale degrees of different modes results in different chord shapes. "1-4-5s in major and the rest in minor " is almost right (for Ionian), but not quite. (in other words : it's wrong!)
To start with, forget the other modes and just consider the Ionian / Major scale. Have a look at How to find out the Major and Minor chords of a scale? and Why do Major keys contain minor chords?.
Then consider why applying the same rules to different modes results in different patterns of chord shapes:
- Also, remember that these rules are only one way of thinking about music. You can put any chord shape anywhere if you can make it work! However, it is definitely good to understand how triads within the diatonic scale work.
Honestly, the simple straightforward answer to your question is you simply make the necessary chromatic alterations in order to create the harmony you desire.
For example, you bring up the "1-4-5 in major and the rest in minor". You only want to do this if you in fact want to STRONGLY establish the key of of the tonic. By making these alterations, you are effectively moving away from the Lydian mode (for example) and moving closer to the Ionian mode (what we know as the "major scale"). Remember your basic studies on tonality, and what tonality is. It is this simple.
Now, your next question would be "well, how do I stay in the Lydian mode (for example) but still establish my tonality on the tonic?" The answer is you don't necessarily use 1-4-5 and all minor, or you can, or you can do something completely different. <- ???. What this means is that there is no black/white comparison between two different modes. As you introduce more and more chromatic alterations of any given mode, you move more and more away from that mode to something else.
Since the I-V relationship is the foundation of tonality (at least in the traditional classical period[baroque-classical-romantic]), an important chromatic alteration would be raising the 7th note of the scale degree (and the 2nd scale degree if required) in order to make the V a major chord; this alone will somewhat strongly define what key you are in (A Lydian rather than B Lydian). Of course you can alter for diminished or dominant 7th chords as well!
Basically, the only "rule" is that you as a composer are required to choose your harmony in a way how you want the music to sound.
EDIT: You should refresh your knowledge on tonality and modulation, since both of those topics will much more fully answer your question: